Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Answer: Can I make recursive calls to subroutines?

by chromatic (Archbishop)
on May 12, 2000 at 18:47 UTC ( #11280=categorized answer: print w/replies, xml ) Need Help??

Q&A > subroutines > Can I make recursive calls to subroutines? - Answer 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);

Log In?

What's my password?
Create A New User
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2017-07-26 09:30 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (387 votes). Check out past polls.