in reply to Passing a file handle to a sub. I still don't get it.
From perlop
If what the angle brackets contain is a simple scalar variable (e.g., <$foo>), then that variable contains the name of the filehandle to input from, or its typeglob, or a reference to the same. For example:
If what's within the angle brackets is neither a filehandle nor a simple scalar variable containing a filehandle name, typeglob, or typeglob reference, it is interpreted as a filename pattern to be globbed, and either a list of filenames or the next filename in the list is returned, depending on context.$fh = \*STDIN; $line = <$fh>;
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing a file handle to a sub. I still don't get it.
by derby (Abbot) on Jun 09, 2005 at 19:24 UTC |