use warnings; use strict; my $path = "path/to/folder/with/my/files"; my @list = qw( a b c d ); foreach my $file ( @list ){ print "found $file\n" if -e "$path/$file"; }