Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Why doesn't this print when i omit the newline?

by karlgoethebier (Abbot)
on Dec 16, 2014 at 13:30 UTC ( [id://1110490]=note: print w/replies, xml ) Need Help??


in reply to Re: Why doesn't this print when i omit the newline?
in thread Why doesn't this print when i omit the newline?

..."Then you should see something interesting"

Here we go:

0 1 use strict; 2 use warnings; 3 use IO::All; 4 5 # v5.18.2 6 # Windows 7 8 my $io = io $0; 9 $| = 1; 10 while ( my ( $index, $value ) = each @$io ) { 11 print qq($index\t$value); 12 sleep 5; 13 print qq($index\t$value\n); 14 15 } 16 __END__ 17 18 19

Thanks and best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^3: Why doesn't this print when i omit the newline?
by davido (Cardinal) on Dec 16, 2014 at 15:45 UTC

    Please don't manually add line numbers to your code. Then if I want to paste it, I have to remove them again. PerlMonks has an option in your user settings to enable line numbers so that you see them next to any code segment.

    You didn't mention what output you are getting here, but on my system I immediately get the first line printed, and then five seconds later I get the first line plus a newline. Then immediately the second line, and five seconds later the second line plus a newline, and so on.

    Ubuntu Linux 14.04 with Perl 5.20.1.

    Ah, I get it... windows, and ikegami nabbed it below. :)


    Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1110490]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-03-28 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found