[Tallahassee-pm] Subroutine Reference
Ed Mansouri
emansouri at ucompass.com
Wed Jan 21 10:15:09 CST 2004
Excellent. This is exactly what I was looking for.
Thanks!
Ed
-----------------------------------------------------------------
Ed Mansouri
Ucompass - http://www.ucompass.com
Make sure we stay connected to you
Add yourself to the Ucompass Address Book
http://support.ucompass.com/addressbook.html
Committed to Building Profitable E-Learning Enterprises
Phone: (850) 297 1800 x 201
FAX: (850) 553-9252
On Wed, 21 Jan 2004, Ryan Carmelo Briones wrote:
> ---------- Original Message ----------------------------------
> From: Ed Mansouri <emansouri at ucompass.com>
> Date: Wed, 21 Jan 2004 10:31:40 -0500 (EST)
>
> >Hello,
> >
> >Is there a built-in variable that will recognize the name of a subroutine
> >currently being executed?
> >
> >In other words:
> >
> >mySub();
> >
> >sub mySub {
> >
> >print ${some_symbol};
> >
> ># and ${some_symbol} will return "mySub"
> >
> >}
> >
> >does anyone know what 'some_symbol' would be to make this possible?
> >
> >Ed
>
> Check out caller():
> http://www.perldoc.com/perl5.8.0/pod/func/caller.html
>
> CODE:
> use Data::Dumper;
> call_sub();
>
> sub call_sub() {
> print Dumper( caller(0) );
> }
>
>
More information about the Tallahassee-pm
mailing list