my @file_list = ( "some_file", "other_file" ); push @file_list, "more_files", "and_more"; for my $file (@file_list) { open my $fh, '<', $file or die "$file: $!"; while (my $line = <$fh>) { chomp $line; # ... } close $fh; }