As a small data point, I've been programming in Perl for more than ten years, and I've never run into perl's call depth limitation, unless it was code that extensively used recursion. But "normal" code where one method or sub calls another simply doesn't hit that limit.
Some gotchas you might encounter:
- Calling subroutines that use eval or system functions can reset your $@ and $! variables, so check them right after the place where an error might have occurred.
- each and regex matching with /g attach (more or less) hidden state to the variables they operate on. Be careful not to leak those variables to subroutines you call. (And be careful not exit a while (my ($key, $value) = each %hash) { ... loop with last or return or die when there's a chance it could be re-entered with the same variable; best avoid it altogether, and iterate over keys %hash in the first place).
- File handles like IN are global; avoid them in favor of lexical file handles.
- Avoid function prototypes unless you know exactly what they are doing.
- die on errors.
- If you pass a large number of similar argument to a bunch of functions, investigate if it might make sense to turn those arguments (or a subset thereof) into an object, and the functions into method.
- Although you can inspect the outer context of a function with wantarray and caller, it is usually a bad idea, because it makes code less composable.