in reply to Getting size of call stack
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting size of call stack
by aufflick (Deacon) on Jan 28, 2005 at 05:05 UTC | |
by diotalevi (Canon) on Jan 30, 2005 at 01:09 UTC | |
by aufflick (Deacon) on Feb 02, 2005 at 04:24 UTC |