Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Deep recursion on subroutine

by NetWallah (Abbot)
on Sep 04, 2013 at 13:38 UTC ( #1052344=note: print w/ replies, xml ) Need Help??


in reply to Deep recursion on subroutine

Add a $recursion_depth parameter to your sub - initialize to zero on the initial call.

Add one on each recursive call.

When the value exceeds some "reasonable" number corresponding to the max expected depth, call "Carp" and bail.

             My goal ... to kill off the slow brain cells that are holding me back from synergizing my knowledge of vertically integrated mobile platforms in local cloud-based content management system datafication.


Comment on Re: Deep recursion on subroutine

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2015-07-07 05:52 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 (87 votes), past polls