in reply to Search Directory
Tested & working
so you can adapt that line to last if grep /$file/,readdir(DIR) ; to make your loop exit early#!/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);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Search Directory
by Anonymous Monk on Feb 01, 2005 at 19:54 UTC | |
by Grygonos (Chaplain) on Feb 01, 2005 at 20:02 UTC |