http://qs321.pair.com?node_id=1031176


in reply to Array of filehandles

You could try as well something like

my %handles = map { open my $fh, '<', $_; $fh => $_ } @files;

and further use keys %handles instead of @handles, and then the filename is $handles{$fh}.