[D]perl小程序求修改Perl code$^I.dat$outfoutfile.txtunless(open OUT,$outf){die cannot op
[D]perl小程序求修改
Perl code
$^I=".dat";$outf="outfile.txt";unless(open OUT,">$outf"){die "cannot open $outf\n";}$outf=~s/(\.\w+?$)/.out/;while(<>){ s/Fred/Larry/gi; print OUT $_;}