Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: useful depth of sub routines

by Laurent_R (Abbot)
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1035465]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2016-12-08 21:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (148 votes). Check out past polls.