Quoting from perlvar:
in reply to Re: Referencing the null file handle, <>
in thread Referencing the null file handle, <>
So what you posted won't work. I don't know of any way reproduce the same function with a passed parameter, although I suspect a tied file handle would be the best way to do so.
- The special filehandle that iterates over command-line filenames in @ARGV. Usually written as the null filehandle in the angle operator <> . Note that currently ARGV only has its magical effect within the <> operator; elsewhere it is just a plain filehandle corresponding to the last file opened by <>. In particular, passing \*ARGV as a parameter to a function that expects a filehandle may not cause your function to automatically read the contents of all the files in @ARGV.