Hi,
I have written a small script that takes an infile, slurps it into an array, and makes a change to the file. Well that is my intention....
I can get the changes to be made using Regular Expressions because I can print and see my H1 tags are changed to H2 tags.
But I have not been able to figure out how to re-write the original file with the changes. I actually want to make these changes to the file, not just prove my loop is capable of making the changes with a print.
Here is my code:
open (INFILE, $ARGV[0]) or die "Error $ARGV[0]: $!\n";
@slurp = <INFILE>;
while (<@slurp>)
{
s#<(/?)H1>#<$1H2>#g;
}
print INFILE @slurp;