When calling a function in recursion we have to be careful to check the stop condition before we call the recursion. If not, we can end up with an infinite recursion that will end only when we have exhausted the resources of our computer.
In order to protect the user from never ending recursions, perl has a hard limit on the number of recursion and if you reach that limit you'll get a warning: Deep recursion on subroutine. The rather arbitrary limit is 100.
Let's see an example.
Perl Maven Pro - screencasts with articles
As a Perl Maven Pro subscriber you will enjoy a growing library of articles and screencasts.
Two screencasts a week and all the previous screencasts!
Ad free browsing!
The articles contain topics such as Web Application Development, Object Oriented programming, testing, deployment, code walkthroughs, best practices, and many more subjects in Perl, and in related technologies.
Subscriptions include all previous pro episodes.
If you already have Perl Maven Pro subscription, you will need to login to access the articles.