This prints out each line to STDOUT. I can redirect the output to a newfile, but what I want to do is overwrite the original file. What would be the most efficient way to do this? Of course I have the more advanced case where I do not want to touch line #1. As far as I can figure out I need a way to bybass $_[0] and only modify after that but am not quite sure how to do itwhile (<>){ chomp $_; $newline = $_ . "_"; print $newline; print "\n"; }
In reply to modifying and overwriting a file by mndoci
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |