in reply to Substitution in a file
You're reading in the data, processing it, but then just throwing it away. You probably want to write out the data to another file.
"Perl makes the fun jobs fun and the boring jobs bearable" - me