Increment the depth until you get nothing back.
Update 1: Oops. I accidentally declared $depth twice.
Update 2: I accidentally put a semi-colon after `my depth = 0` which screws up the parameters for the for(;;). Replacing it with a comma keeps the correct meaning.
my @stack; for ( my $depth = 0, my $frame = [ caller $depth ]; scalar( @$frame ); $depth++ ) { push @stack, $frame; }
In reply to Re: Getting size of call stack
by diotalevi
in thread Getting size of call stack
by Sprad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |