in reply to Sorry, Lets try the long version.
in thread Return values, Closure Vars from File::Find &wanted subs?
Have you considered passing and returning data to/from these subs?
use strict; use File::Find; main(); exit; sub main { dostuff($_) for findit( @ARGV ); } sub findit { my( $root ) = @_; my @dirlist; find( sub { -d $_ or push @dirlist, $File::Find::name; }, $root ); @dirlist } sub dostuff { print "$_\n" }
It should be noted that the above uses a closure, which is one way to "eliminate" global variables without unduly restricting access to them.
|
|---|