in reply to Return values, Closure Vars from File::Find &wanted subs?
and I want to do it without the global my @dirlist at the top.use strict; use File::Find; sub main; my @dirlist; main(); exit; sub main { findit(); dostuff($_) for @dirlist; } sub findit { find(\&wanted, shift(@ARGV)); } sub wanted { return unless -d $_; push(@dirlist,$File::Find::name); } sub dostuff { print "$_\n" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorry, Lets try the long version.
by jdporter (Paladin) on Nov 16, 2005 at 17:59 UTC | |
|
Re: Sorry, Lets try the long version.
by Roy Johnson (Monsignor) on Nov 16, 2005 at 17:48 UTC |