Можно, например, так:
use strict;
my $file = \'AUTOEXEC.BAT\';
chdir \'c:/\';
print "yes" if grep{/$file/} <*>;
или
use strict;
opendir DIR,\'c:/\';
my $file = \'AUTOEXEC.BAT\';
while (my $f = readdir DIR) {
print \'yes\' if $file eq $f;
}
или
use strict;
print \'yes\' if -e \'c:/AUTOEXEC.BAT\';