perl 匹配某行后添加字符串
#!/usr/bin/perl ## Copyright (c) 2011 by mcshellmy %do_these;
foreach (@ARGV) {
$do_these{$_}=1;
}
while (){
if(/^## Copyright /){
delete $do_these{$ARGV};#如果存在就删除它
}
}
@ARGV= sort keys %do_these;
$^I=".mc";
while (){
if(/^#!/){
$_ .= "## Copyright (c) 2011 by mcshell\n";
}
print;
}
页:
[1]