my @files = qw( /foo/bar.txt /foo/boo.txt ); for my $file (@files) { open my $fh, "<", $file or die "Could not open $file: $!"; # tu was mit $fh }