My error message:use strict; my $mydir = "/path/paths"; my $bool = 0; opendir(DIR, $mydir) || die "Can not open $mydir: $!\n"; while (my $file = readdir(DIR)) { if($file =~ /^myname\.doc$/i) { $bool = 1; } } closedir(DIR); if($bool) { print "$file"; }
Global symbol "$file" requires explicit package name at C:\Perl\bin\sc +rp.pl line 22. Execution of C:\Perl\bin\scrp.pl aborted due to compilation errors.
In reply to Passing value outside of loop by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |