in reply to Using an array of file handles

Hello Laurent_R,

Since <FH> is Perl’s syntactic sugar for readline(*FH) (see readline), a straightforward way to disambiguate the syntax is to call readline directly:

while (my $line = readline $in_fh[$i]) { print $line; }

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Using an array of file handles
by Laurent_R (Canon) on Apr 22, 2016 at 19:28 UTC
    Thanks Athanasius. Yes, readline is actually what I used to work around my problem, as I mentioned in my original post, but I was looking for a solution with the diamond operator. It appears that it can't work directly with a filehanbdle that is stored as an array or hash element, so that either readline or an intermediate variable is required.