in reply to Usage of the DB-module (debugger)

The code in Carp::Heavy doesn't access lexical variables but the parameter arrays @_ of calling functions up the stack. This is enabled by calling caller() from the package DB, presumably an efficiency hack.

To access lexical variables in calling subs there's the module PadWalker available from CPAN. All I remember from playing with it once is that it wasn't quite as easy to use as I would have wished.

Anno

Replies are listed 'Best First'.
Re^2: Usage of the DB-module (debugger)
by Tobiwan (Beadle) on Mar 22, 2007 at 13:52 UTC
    Yes, it access the @_ but in fact, thats a lexical array for every subroutine, I think. But the PadWalker is exactly, what I'm searching for. Thanks for this wisdom.
      No, @_ is a (special) package variable, not a lexical one.

      Anno