in reply to Re: Debugger Bug?
in thread Debugger Bug?

I'm confused about the buffering, why should x turn on any buffering at all?

DB<24> @arr=a..z DB<25> x print @arr 0 1 DB<26> abcdefghijklmnopqrstuvwxyz DB<26> print @arr abcdefghijklmnopqrstuvwxyz DB<27>

please note at line 26 I just typed return !?!

Cheers Rolf

UPDATE: "This is perl, v5.10.0 built for i486-linux-gnu-thread-multi"

Replies are listed 'Best First'.
Re^3: Debugger Bug?
by ikegami (Patriarch) on Sep 02, 2009 at 23:52 UTC

    Buffering is on by default. Try perl -e"print 'foo'; sleep 5; print 'bar'"

    please note at line 26 I just typed return !?!

    Reading from STDIN is documented to flush STDOUT. (One or both may need to be associated with a terminal for that to occur.)

      Sure, turning on AUTOFLUSH helps!

      DB<1> $| = 1 DB<2> x print "horst" horst0 1 DB<3> p print "horst" horst1 DB<4> print "horst" horst

      But it's strange that only x doesn't flush automatically while other commands do ...

      DB<5> $| = 0 DB<6> x print "horst" 0 1 DB<7> print "horst" horsthorst DB<8> p print "horst" 1horst

      Cheers Rolf

        But it's strange that only x doesn't flush automatically

        Not any stranger than using x and print together. I'm not terribly surprised that this particular combination was not "expected". In any case, the code in question is:

        # Turn off the one-time-dump stuff now. if ($onetimeDump) { $onetimeDump = undef; $onetimedumpDepth = undef; } elsif ( $term_pid == $$ ) { eval { # May run under miniperl, when not ava +ilable... STDOUT->flush(); STDERR->flush(); }; # XXX If this is the master pid, print a newline. print $OUT "\n"; }

        - tye