in reply to Indirect Referencing

From perldoc perlop:
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. This distinction is determined on syntactic 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 hash element.
You can try the readline function rather than the <> operator. It is not clear to me whether you get all the default behaviors when using readline.

We're not really tightening our belts, it just feels that way because we're getting fatter.

Replies are listed 'Best First'.
Re^2: Indirect Referencing
by periapt (Hermit) on Jun 17, 2004 at 14:35 UTC
    Darn, I missed that. I'm not hung up on using the hash element, I just got running down the wrong track. Thanks.

    PJ
    We are drowning in information and starving for knowledge - Rutherford D. Rogers
    What good is knowledge if you have to pull teeth to get it - anonymous
Re^2: Indirect Referencing
by Aragorn (Curate) on Jun 17, 2004 at 20:50 UTC
    Update: Argh! Nevermind, I misunderstood the question.
    If what's within the angle brackets is neither a filehandle nor a simple scalar variable containing a filehandle name, typeglob, or typeglob reference,
    $infh is a typeglob reference, so it should work. Actually, it does, if the while(<$infh}>){ is replaced by while(<$infh>){.

    Small change, big results ;-)

    Arjen