in reply to confused about local $/ in perl debugger
I'm not a regular user of the perldebugger, but my understanding was that x worked from the package scope, not the lexical scope. If you wanted to dive down into the lexical scope, you needed y (and the PadWalker module). The debugger isn't terribly smart... hooked around the whole application, and thus outside the lexical scope in question. It's non-trivial to probe a lexical/local from outside their scope.
This appears true for my lexicals and locals. Try:
my $foo = 10; $bar = 10; sub somelocals { my $foo = 42; local $bar = 42; # "x $foo", "x $bar" are 10 here } somelocals();
Update:
This seems version dependent - my results and yours are consistent with v5.8.0. On v5.8.6, I see the opposite behaviour with x. (ie. lexicals are exposed as expected.)
re-Update:
Ignore. My testing was flawed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: confused about local $/ in perl debugger
by lupey (Monk) on May 24, 2005 at 14:26 UTC | |
by fishbot_v2 (Chaplain) on May 24, 2005 at 14:47 UTC |