in reply to Re^2: Get first caller and its arguments
in thread Get first caller and its arguments

In the caller docs, did you read this:
Furthermore, when called from within the DB package, caller returns more detailed information: it sets the list variable @DB::args to be the arguments with which the subroutine was invoked.
Also look (and/or use) Devel::Caller::Perl (which uses the "called within the DB package" technique) or Devel::Caller.
  • Comment on Re^3: Get first caller and its arguments

Replies are listed 'Best First'.
Re^4: Get first caller and its arguments
by OlegG (Monk) on Sep 12, 2011 at 17:19 UTC
    did you read this
    Yes, but it says i can use it only in the debugger, not in my script. However i can miss smth, because i am not familar with Perl debugger.
    Also look (and/or use) Devel::Caller::Perl
    Thanks, this works.
      ...it says i can use it only in the debugger

      No, that's not what it says. Look at the source for Devel::Caller::Perl, and that might give you an idea of what it really says.

Re^4: Get first caller and its arguments
by OlegG (Monk) on Sep 12, 2011 at 17:27 UTC
    It seems I understood "called with the DB package" technique
    package DB; use Data::Dumper; sub a { b() } sub b { c() } sub c { my @a = caller(2); print Dumper \@a; print Dumper \@DB::args; } a("test", [1,2,3]);