Just to make CountZero's good suggestion more obvious, your code should probably look like this:
#!/usr/bin/perl use strict; use warnings; $^I = ".old"; while (<>) { if (/^#!/) { $_ .= " ## Copyright (C) 2008 me\n"; } print; }
The way you had it, the print would only happen on the line where you made the change. This way, every line is printed, whether you changed it or not.
In reply to Re^3: clobbering output
by kyle
in thread clobbering output
by bluethundr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |