my $dir = "start"; foreach my $file (@files) { my $path = "$dir/$file"; open FILE, $path or die "Can't open file '$path': $!"; while () { print $_; } }