The evil <> operator which tries to figure out if it's dealing with a filehandle or a glob operation ... you'll want to take a look at perlop for more details of how perl figures this out:
You'll want to either do:If what’s within the angle brackets is neither a filehandle nor + a sim‐ ple scalar variable containing a filehandle name, typeglob, or +typeglob reference, it is interpreted as a filename pattern to be globbe +d, and either a list of filenames or the next filename in the list is returned, depending on context. This distinction is determined + on syn‐ tactic grounds alone. That means "<$x>" is always a readline() + from an indirect handle, but "<$hash{key}>" is always a glob(). That’s + because $x is a simple scalar variable, but $hash{key} is not--it’s a h +ash ele‐ ment. Even "<$x >" (note the extra space) is treated as "glob( +"$x ")", not "readline($x)".
or you'll want to:my $fh = $test{FH}; print <$fh>;
Hope that helps,use IO::Handle; print $test{FH}->getlines();
In reply to Re: Getting file handle glob name instead of contents
by Tanktalus
in thread Getting file handle glob name instead of contents
by stevendel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |