in reply to Using an array of file handles

Easy workaround:

for my $handle (@in_fh) { while (<$handle> ) { print ; } }

You also have an "off-by-one" error: $i <= $count which you would have spotted by using strict and warnings.

Replies are listed 'Best First'.
Re^2: Using an array of file handles
by Laurent_R (Canon) on Apr 22, 2016 at 12:34 UTC
    Thank you hdb. Yes, sure, but finding a workaround was not really my problem (I actually presented one in my original post), my problem was that I was convinced that it was possible to read lines directly from something like <{$a[$c]}>, and it turns out that this was wrong.

    As for the off-by-one error, you're correct, but it's a mistake I did when trying to simplify the code for the post, I did not have the error in my slightly more complicated original code. Yes, I am using strict and warnings for all my programs (except possibly very simple one-liners).