foreach my $file (@files) { my $fh; open $fh, "<", $file or die "Can't open $file ($!)"; push @filehandles, $fh; }