I tweaked it a bit, setting $depth to -1
Wouldn't your subroutine always return -1? Shouldn't your GetCallStackDepth look more like:
sub GetCallStackDepth { my $depth = 1; # 0 is this sub, why bother checking it? $depth++ while caller($depth); return $depth - 1; }
In reply to Re: Re: Re: Getting size of call stack
by Anonymous Monk
in thread Getting size of call stack
by Sprad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |