Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Passing value outside of loop
by davorg (Chancellor) on Jan 07, 2003 at 16:32 UTC | |
Re: Passing value outside of loop
by hardburn (Abbot) on Jan 07, 2003 at 16:33 UTC | |
Re: Passing value outside of loop
by FamousLongAgo (Friar) on Jan 07, 2003 at 16:36 UTC | |
by Anonymous Monk on Jan 07, 2003 at 17:52 UTC | |
Re: Passing value outside of loop
by thewalledcity (Friar) on Jan 07, 2003 at 16:36 UTC | |
Re: Passing value outside of loop
by Arien (Pilgrim) on Jan 08, 2003 at 08:04 UTC |