in reply to Re^2: clobbering output
in thread clobbering output
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.
|
|---|