Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Return values, Closure Vars from File::Find &wanted subs?by Subliminal Kid (Initiate) |
on Nov 16, 2005 at 16:54 UTC ( [id://509101]=perlquestion: print w/replies, xml ) | Need Help?? |
Subliminal Kid has asked for the wisdom of the Perl Monks concerning the following question:
How do I get the list of files I create with File:Find's wanted sub out of that subroutine and returned to my main program?
Someone said to use Closure Vars and I read "Subroutine References and Closures" from Advanced Perl Programming but I'm not getting it. HELP Cheers, James Sorry, Lets try the long version since I seem to have miss queued the answers (My mistake) Sorry, I'm obviously not making myself clear here. I don't want to use a Global variable. I have a program in the form: and I want to do it without the global my @dirlist at the top. I have dumped about 800 odd lines of someone's code & 60 odd subs from this example so massive rewrites aren't the order of the day but I do need to take out all these bloody global vars because they are making my life a real headache. I'm not sure I understand why I can't just return the array from &wanted or at the very least declare it in findit and have wanted inherit it but <shrugs>.
Back to
Seekers of Perl Wisdom
|
|