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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |