in reply to file::find question
I want to see if I can do it without using a globalYou can use a lexical variable in an enclosing scope. E.g.
Even if the variable is at file scope level, it's still lexical, not global, if it's declared with "my".sub do_things_with_files { my @files_found; find( sub { if ( ... ) { push @files_found, $File::Find::name; } }, '.' ); }
For further info, you might want to check out the recent tutorial, "Lexical scoping like a fox".
When I search for "file::find" it only gives perldoc, I would like to see all user postsUse the Super Search.
jdporter
...porque es dificil estar guapo y blanco.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: file::find question
by smackdab (Pilgrim) on Nov 21, 2002 at 04:19 UTC | |
by dakkar (Hermit) on Nov 21, 2002 at 11:10 UTC | |
by jdporter (Paladin) on Nov 21, 2002 at 15:48 UTC |