[Rajeev, please keep beginner topics on the list]

> Thanks again

You're welcome :>

> But how to calculate the $calldepth value here.
>
> Actually I tried with the values for $i or $calldepth as given in the
docs.

(Note that I just made up the variable name $calldepth.)

> I understand that 1 represents the first level of call. and 2 second.
> In can of recursions and loops how can we keep track of "just previous
> level" here?

Er, that's 1. The call depth goes backwards.
0 = current sub
1 = caller (sub that called the current sub)
2 = caller's caller (sub that called the sub that called the current
sub)

Also, "Be aware that the optimizer might have optimized call frames
away before `caller' had a chance to get the information."

hth

> with regards
>
> Rajeev Rumale
>
>
> ----- Original Message -----
> From: "Me" <[EMAIL PROTECTED]>
> To: "Rajeev Rumale" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, August 07, 2001 2:53 PM
> Subject: Re: getting the calling function name.
>
>
> > > "caller" only gives only the name of current sub
> >
> > You didn't read the docs carefully enough...
> >
> >     caller($calldepth)
> >
> >     perldoc -f caller
> >
> >



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to