#!/Perl/bin/perl use strict; use warnings; my $dir = 'c:/'; my $file = 'autoexec.bat'; opendir(DIR,$dir); print "found" if grep /$file/,readdir(DIR) ; closedir(DIR);