Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Deep recursion problem

by jethro (Monsignor)
on Oct 21, 2011 at 15:10 UTC ( #932924=note: print w/ replies, xml ) Need Help??


in reply to Deep recursion problem

DB:: is AFAIK the namespace of the debugger, so only the debugger will use that variable. If you want to recurse deeply, then just use "no warnings 'recursion';", as you already found out. Such a warning would have no value to you when you want to do arbitrarily deep recursion anyway.

And if you really need a limit, count the recursion yourself with an additional parameter (clunky but effective):

sub size_of_an_array { my($i, @array) = @_; ... return(++$i, 1 + size_of_an_array(@array));


Comment on Re: Deep recursion problem
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932924]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (13)
As of 2014-11-26 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (172 votes), past polls