|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: How to replace strings in a file from a list?by Kenosis (Deacon) |
| on Oct 03, 2012 at 03:49 UTC ( #996973=note: print w/ replies, xml ) | Need Help?? |
|
Here's another option:
Using File::Slurp is a nice way to get the file's contents into a scalar upon which global substitutions can be performed. The before and after names in the __DATA__ area are tab separated. Note that the changed file contents are written to the file named "changed_$ARGV[0]". Hope this helps!
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||