The stupid question is the question not asked | |
PerlMonks |
Re: sub and anonymous subby rinceWind (Monsignor) |
on Jun 21, 2002 at 12:59 UTC ( [id://176268]=note: print w/replies, xml ) | Need Help?? |
Interestingly, I thinkl there is a cleaner way to do it. My experience of other programming languages is showing. The algorithm you have given is non-reentrant, hence non-threadsafe. Instead, I prefer passing in a level number to recurse, which means that separate threads calling recurse will not interfere with one another. I know perl is not thread safe, but perl 6 and/or perl 5.x might be. My $0.02 --rW Update: Gerbil is right. I don't need the extra braces. This is what comes with cutting and pasting someone else's example rather than rewriting from scratch. Have edited the example to take on Gerbil's suggestions
In Section
Seekers of Perl Wisdom
|
|