in reply to Re^3: Opening a file, editing, copying to another
in thread Opening a file, editing, copying to another

You have to know about and use $_ if you use map, grep or for (as a statement modifier) and for various common Perl idioms. If you are not using map, grep or statement modifiers then you are missing out on some major workhorses in Perl.

In the op's situation I agree that using a variable is likely to make the intent clearer, but there are a multitude of problems with the code apart from that.


DWIM is Perl's answer to Gödel
  • Comment on Re^4: Opening a file, editing, copying to another