This queue is for tickets about the Devel-REPL CPAN distribution.

Report information
The Basics
Id:
78542
Status:
open
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
1.003013
Fixed in:
(no value)



Subject: Doesn't flush STDOUT after running code
print() without a linefeed isn't flushed after the command is run, before printing the next prompt. Perl defers it until EOF: pevans@paulevans:~ $ re.pl $ print "hello" 1 $ $ $ hello pevans@paulevans:~ -- Paul Evans
Subject: Re: [rt.cpan.org #78542] Doesn't flush STDOUT after running code
Date: Mon, 23 Jul 2012 13:43:34 -0400
To: bug-Devel-REPL@rt.cpan.org
From: Chris Marshall <devel.chm.01@gmail.com>
How does this differ from the behavior of perl running the same from a file? On Mon, Jul 23, 2012 at 1:25 PM, Paul Evans via RT <bug-Devel-REPL@rt.cpan.org> wrote:
Show quoted text
> Mon Jul 23 13:25:13 2012: Request 78542 was acted upon. > Transaction: Ticket created by PEVANS > Queue: Devel-REPL > Subject: Doesn't flush STDOUT after running code > Broken in: 1.003013 > Severity: Normal > Owner: Nobody > Requestors: leonerd-cpan@leonerd.org.uk > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78542 > > > > print() without a linefeed isn't flushed after the command is run, > before printing the next prompt. Perl defers it until EOF: > > > pevans@paulevans:~ > $ re.pl > $ print "hello" > 1 > $ > > $ > > $ hello > pevans@paulevans:~ > > -- > > Paul Evans
On Mon Jul 23 13:43:47 2012, devel.chm.01@gmail.com wrote:
Show quoted text
> How does this differ from the behavior > of perl running the same from a file?
Oh it's not really that different. It's just I feel that as Devel::REPL knows the expression is nominally "done" by the time it returns and before the next prompt is printed, it should flush STDOUT anyway before the next prompt is printed. -- Paul Evans
Subject: Re: [rt.cpan.org #78542] Doesn't flush STDOUT after running code
Date: Mon, 23 Jul 2012 13:55:56 -0400
To: bug-Devel-REPL@rt.cpan.org
From: Chris Marshall <devel.chm.01@gmail.com>
I guess it all depends on whether you want the Devel::REPL shell to match a perl program or not (e.g., if you wish to cut and paste from a file into the command line). However, you can just set $|=1 and get the behavior desired. Maybe using say would work as well. --Chris On Mon, Jul 23, 2012 at 1:52 PM, Paul Evans via RT <bug-Devel-REPL@rt.cpan.org> wrote:
Show quoted text
> Queue: Devel-REPL > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78542 > > > On Mon Jul 23 13:43:47 2012, devel.chm.01@gmail.com wrote:
>> How does this differ from the behavior >> of perl running the same from a file?
> > Oh it's not really that different. It's just I feel that as Devel::REPL > knows the expression is nominally "done" by the time it returns and > before the next prompt is printed, it should flush STDOUT anyway before > the next prompt is printed. > > -- > > Paul Evans
Subject: Re: [rt.cpan.org #78542] Doesn't flush STDOUT after running code
Date: Mon, 23 Jul 2012 12:56:02 -0500
To: "devel.chm.01@gmail.com via RT" <bug-Devel-REPL@rt.cpan.org>
From: Jesse Luehrs <doy@tozt.net>
On Mon, Jul 23, 2012 at 01:43:49PM -0400, devel.chm.01@gmail.com via RT wrote:
Show quoted text
> How does this differ from the behavior > of perl running the same from a file?
It's pretty standard practice for interactive programs (as opposed to scripts) to flush STDOUT before prompting the user for input (see getch() in curses, for instance). -doy
Subject: Re: [rt.cpan.org #78542] Doesn't flush STDOUT after running code
Date: Mon, 23 Jul 2012 13:58:09 -0400
To: bug-Devel-REPL@rt.cpan.org
From: Chris Marshall <devel.chm.01@gmail.com>
True. I don't have a problem with setting $|=1 by default. It would allow users to switch back to the other behavior if desired.... On Mon, Jul 23, 2012 at 1:56 PM, Jesse Luehrs via RT <bug-Devel-REPL@rt.cpan.org> wrote:
Show quoted text
> Queue: Devel-REPL > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78542 > > > On Mon, Jul 23, 2012 at 01:43:49PM -0400, devel.chm.01@gmail.com via RT wrote:
>> How does this differ from the behavior >> of perl running the same from a file?
> > It's pretty standard practice for interactive programs (as opposed to > scripts) to flush STDOUT before prompting the user for input (see > getch() in curses, for instance). > > -doy >


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.