in reply to Find and Replace multiple values in a file.
You open the file for writing (the second line above) which totally clears your file before you even read what was in it (third line).open (IN, "+<G203.xml"); open (OUT,">_G203.xml") || die ("Cannot open file"); @string1 = <IN>;
So you never ever get anything inside @string1. Hence you replace nothing and you write out nothing!
Update: Oops. Sorry. My wrong. I did not notice the underscore in the second file name. Please disregard the above.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|