in reply to writing files while reading files

One other thing should be mentioned is the -i command line switch. It specifies that using <> operator will edit files in place with an optional extension to rename the input file. See perlrun for the details.

--

flounder