can we discuss how to do this with the -i modifier, if this is the right tool, or how other people handle this common task? Your wisdom is much appreciated. -mallocopen(FH,"myfile") or die "e tu brutus?\n"; # clobber it. while(<FH>) if ($_ =~ m/foo/){ $line = $_; $line =~ s/foo/bar/g; } else{ $line = $_; } $file = $file . $line; } open (FH,"> myfile") or die "e tu brutus?\n"; print FH $file
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |