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:

If what’s within the angle brackets is neither a filehandle nor + a sim&#8208; 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&#8208; 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&#8208; ment. Even "<$x >" (note the extra space) is treated as "glob( +"$x ")", not "readline($x)".
You'll want to either do:
my $fh = $test{FH}; print <$fh>;
or you'll want to:
use IO::Handle; print $test{FH}->getlines();
Hope that helps,


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.