Maybe I'm missing something, but this behavior of x and p looks very odd to me:

lanx@nc10-ubuntu:~$ perl -de0 Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> p print "lula" 1lula DB<2> x print "horst" 0 1 DB<3> p print "lula" 1horstlula DB<4> p print "lula" 1lula DB<5> p print "lula" 1lula ... DB<11> x print "horst" 0 1 DB<12> x print "horst" 0 1 DB<13> x print "horst" 0 1 DB<14> p print "lula" 1horsthorsthorstlula

Cheers Rolf

UPDATE: improved example code.

UPDATE2: INTERPRETATION: Sleeping about it brought some insight about the fundamental differences between a debugger and a shell resp. REPL. I'm mostly using the debugger as a shell, expecting to get every line's output directly after typing. A debugger OTOH shouldn't alter the standard behavior of perl in order to find errors, and this naturally includes buffering.

While it's strange that p flushes and x doesn't, the wanted REPL behavior can be achieved by setting $| to 1.


In reply to Debugger Bug? by LanX

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.