Just another Perl shrine | |
PerlMonks |
Re: FileHandles in a Hash (<> ambiguity)by LanX (Saint) |
on May 28, 2014 at 16:07 UTC ( [id://1087677]=note: print w/replies, xml ) | Need Help?? |
Without testing I think you fell into a special trap of '<>'... The <> operator has DWIM magic to act either as glob or readline. So it tries to use your hash like a list of filename patterns to be expanded like glob does. Like others indicated just use readline to avoid ambiguity or copy the hash element to a simple scalar. HTH! :)
Cheers Rolf ( addicted to the Perl Programming Language)
updatesee I/O Operators:
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.
In Section
Seekers of Perl Wisdom
|
|