while(<>){
@name=split (" ",$_);
open FH,">>name_file.txt";
my $i=0;
while ($i <=$#name){
$length=length($name[$i])/2;
if ($length>1) {
print FH "$name[$i] ";
}
elsif($length=1){
print FH "$name[$i]$name[$i+1] " ;
$i+=1;
}
$i+=1;
}
print FH "n";
}
close FH;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/6456/viewspace-1015292/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/6456/viewspace-1015292/