in reply to Passing value outside of loop
Try this instead:
my $found; while ( my $file = readdir(DIR) ){ $found = $file, last if $file=~/^myname\.doc$/i; } closedir(DIR); print "Found: $found" if $found;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing value outside of loop
by Anonymous Monk on Jan 07, 2003 at 17:52 UTC |