|
|
| XP is just a number | |
| PerlMonks |
Re: copying a file with .bak extensionby kennethk (Monsignor) |
| on Nov 07, 2012 at 18:27 UTC ( #1002708=note: print w/ replies, xml ) | Need Help?? |
|
I assume this is the entire body of the script, and not just a snippet. I also assume you are running perl with the -i switch. If you simply modify that to be perl -i.bak ..., your issue will be solved. See perlrun. If you have your -i switch in your hashbang, just modify it there instead. Update: If all you are doing is appending "\n##Copyright (C) 2012 by firstName lastName\n" to the tail of the file, why are you using switches when you could just open the file for appending, and append? e.g.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||