Hello All,
Gabor Azabo re-directed me to this site and I hope someone can give me a guide and clue.
I have wrote a Perl script to update about 1200 files for searching and replacing.
I have used a array of hashes like my
@myHashArray = ( {toFind => '<Image Name="Logo"> <Source>Embedded</Sou +rce>', toReplace => '<Image Name="Logo"><Source>E +xternal</Source>' }); Then I use this statement to find and replace the file. $data =~ s/$_->{toFind}/$_->{toReplace}/g foreach (@myHashArray);
Everything is working great and I am creating a log file (name of files I have changed) but I like also to get the values I have changed in that document. I want to get the value of /$_->{toFind}/ and toReplace in a log file too. Currently my log file is something like:
01- FirstFile.xml
02- SecondFile.xml
But want to have something like
01- FirstFile.xml
a. Original line: <Image
Name="Logo"><Source>Embedded</Source>
b. Replace with: <Image Name="Logo"><Source>External</Source>
And so on...
In reply to array of hashes help by rv799cv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |