my ($fh1, $fh2, $fh3, $fh4, $fh5); ... open ($fh1, '<', $file1) or die $!; #### open (my $fh1, '<', $file1) or die $!;