Thanks Shawn and Jim. caller(0) did the trick.

Cheers,
Parag




On Thu, Dec 30, 2010 at 8:11 PM, Jim Bauer <holdsworth...@eml.cc> wrote:
> On Thu, 30 Dec 2010 18:30:04 -0800, Parag Kalra wrote:
>> Hi,
>>
>> Just like $0 reveals the current script name is there any variable
>> using which I can find the current sub-routine I am currently in.
>  printf("currently in %s\n", (caller(0))[3] =~ /^.+:(\w+)$/);
>
> See `perldoc -f caller'.
> -----------
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to