LanX has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Debugger Bug?
by ikegami (Patriarch) on Sep 02, 2009 at 23:18 UTC | |
by LanX (Saint) on Sep 02, 2009 at 23:32 UTC | |
by ikegami (Patriarch) on Sep 02, 2009 at 23:52 UTC | |
by LanX (Saint) on Sep 03, 2009 at 00:16 UTC | |
by tye (Sage) on Sep 03, 2009 at 02:08 UTC | |
|