Next | Tricks of the Wizards | 25 |
In The Beginning, filehandles weren't first-class values
Consider code like this:
open FH, ...; print FH ...; $z = <FH>; close FH;
Here FH is actually a literal string (a 'bareword')
Almost as if you had written something like this:
open "FH", ...; print "FH" ...; $z = <"FH">; close "FH";
All Perl's I/O functions expect to get strings
They then resolve the string to a glob in the usual way
Then they extract the filehandle part of the glob
Next | Copyright © 2003 M. J. Dominus |