use strict; my $file; # Read the current directory into an array opendir(my $dir, '.'); my @files = readdir($dir); closedir ($dir); # Iterate over array to file file foreach $file(@files) { print "$file"; if ($file eq 'carlos.txt') { print " <------------- Found File"; } print "\n"; }