Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: useful depth of sub routines

by Laurent_R (Parson)
on May 27, 2013 at 21:33 UTC ( #1035465=note: print w/ replies, xml ) Need Help??


in reply to useful depth of sub routines

I do not think that you have to worry too much. unless what you are doing is getting really hairy, you will probably not reach a limit. I have had at least a couple of cases of really complicated nested function calls, but never reached a limit, except of course sometimes for the deeply nested recursive call, but, yet, it is only a warning.

A naive recursive approach to the Fibonacci series can lead to 331 million nested calls of the Fibo function if you want to calculate the 40th Fibonacci number, that is definitely not very time efficient (a few minutes on my computer), but that still works perfectly. I doubt that you will get anywhere near that in a non recursive approach.


Comment on Re: useful depth of sub routines

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-12-25 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (160 votes), past polls