Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Answer: Can I make recursive calls to subroutines?

( #11280=categorized answer: print w/ replies, xml ) Need Help??

Q&A > subroutines > Can I make recursive calls to subroutines? contributed by chromatic

Yes. Perl will even warn you if the recursion stack gets too deep (I'm currently around 200,000 calls).
use strict; sub head_for_the_deep { my $depth = shift; print "Sinking to level $depth.\n"; head_for_the_deep($depth + 1); } head_for_the_deep(0);

Comment on Answer: Can I make recursive calls to subroutines?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2015-02-27 11:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    On my keyboard, Caps lock is:








    Results (443 votes), past polls