Yup, $depth is probably getting set on the first invocation and never getting updated un subsequent invocations. See this article
In reply to Re^2: Recursion and Such
by djantzen
in thread Recursion and Such
by Grundle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |