In the "for my $dir" loop, $dir is LOCAL to the block enclosed by the "for" loop, so the "wanted" sub cannot see it.
To fix, keep $dir global:
my $dir; for $dir (@...)...
"I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
-- Dr. Cox, Scrubs
In reply to Re: File::Find in a loop
by NetWallah
in thread File::Find in a loop
by vagabonding electron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |