Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 examining the Monastery: (2)
As of 2014-09-24 03:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls