Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 avoiding work at the Monastery: (6)
As of 2015-07-29 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls