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.


In reply to Re: confused about local $/ in perl debugger by fishbot_v2
in thread confused about local $/ in perl debugger by lupey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.