As I already said "you can get run-time warnings but not compile-time warnings for code entered at the debuger's command prompt," which I think answers part of your question. And I doubt there are any docs that cover this.

As for the "why", I assume that the debugger restores $^W in-line with the eval of your code via the equivalent of eval "\$^W= $saved; $your_code" (it actually restores quite a few things so the syntax isn't quite what I wrote) which means that $^W isn't restored until after that code is compiled. Patching the debugger to do eval "BEGIN{$^W= saved} $your_code" would correct that but you'll have to be careful to separate the things that need to be restored at compile time from the things that can't be restored from within the BEGIN block because the restoration would be ruined when you leave the scope of that block.

Creating such a patch sounds like a reasonable project. Let me know if you run into problems. ;)

        - tye (but my friends call me "Tye")

In reply to (tye)Re4: Debugger, use strict, use warnings by tye
in thread Debugger, use strict, use warnings by Coleoid

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.