1 Star 0 Fork 4

jing/pcre3

forked from openKylin/pcre3 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Detrail 643 Bytes
一键复制 编辑 原始数据 按行查看 历史
openKylinBot 提交于 2022-05-14 02:39 . Import Upstream version 8.39
#!/usr/bin/perl
# This is a script for removing trailing whitespace from lines in files that
# are listed on the command line.
# This subroutine does the work for one file.
sub detrail {
my($file) = $_[0];
my($changed) = 0;
open(IN, "$file") || die "Can't open $file for input";
@lines = <IN>;
close(IN);
foreach (@lines)
{
if (/\s+\n$/)
{
s/\s+\n$/\n/;
$changed = 1;
}
}
if ($changed)
{
open(OUT, ">$file") || die "Can't open $file for output";
print OUT @lines;
close(OUT);
}
}
# This is the main program
$, = ""; # Output field separator
for ($i = 0; $i < @ARGV; $i++) { &detrail($ARGV[$i]); }
# End
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jing2002/pcre3.git
git@gitee.com:jing2002/pcre3.git
jing2002
pcre3
pcre3
openkylin/yangtze

搜索帮助

0d507c66 1850385 C8b1a773 1850385