Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 romping around the Monastery: (7)
As of 2014-12-29 14:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (188 votes), past polls