in reply to Re: Identify the package a subroutine is being called from
in thread Identify the package a subroutine is being called from
This may work, depending on what happened to @_:
package DB; sub get_calling_object { my @foo = caller(2); return $DB::args[0] }
Update: This needs the package declaration.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Identify the package a subroutine is being called from
by jettero (Monsignor) on Jun 06, 2008 at 17:47 UTC | |
by chromatic (Archbishop) on Jun 06, 2008 at 20:04 UTC | |
by jettero (Monsignor) on Jun 07, 2008 at 04:00 UTC | |
by chromatic (Archbishop) on Jun 07, 2008 at 04:38 UTC | |
by jettero (Monsignor) on Jun 07, 2008 at 23:36 UTC |