[Chicago-talk] how to get calling depth ?

Steven Lembark lembark at wrkhors.com
Mon Oct 17 16:10:28 PDT 2005

-- komtanoo <komtanoo at gmail.com>

> Hello, 
> I try to solve a problem by calling a function like: 
> my @kk = caller($zz); 
> The $zz should be the outmost of the calling stack. 
> Currently, I have to loop form $zz=0 to inf to find the maximum $zz 
> that makes caller return not null data. I doubt that perl 
> maintains some special varaiable for the maximum value of "caller
> function" 
> or in other word, current depth of calling stack. 
> Anybody know how to get it without keep calling the caller function ? 

Use half-interval, but aside from that all you 
can do is walk up the chain. Start with, say,
caller(64) and work your way down 32 +/- 16...

Steven Lembark                                       85-09 90th Street
Workhorse Computing                                Woodhaven, NY 11421
lembark at wrkhors.com                                     1 888 359 3508

More information about the Chicago-talk mailing list