in reply to Chat Client Paste Parser
Some quick comments:
- Your open statements should check if they succeed, something like this works:
open (INPUT, $ARGV) or die "Couldn't open $ARGV: $!";
- Don't use a foreach loop here, this reads the whole input file into memory. You want to process the file line by line so just use while (my $line = <INPUT>)
- Take the open OUTPUT out of the loop. At the moment you are opening and closing the output file for every line you are processing, very inefficient. This is so, because open implicitly closes the file before it opens it again.