Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Print vs Say with sleep function

by Laurent_R (Canon)
on Jan 19, 2016 at 23:02 UTC ( [id://1153130]=note: print w/replies, xml ) Need Help??


in reply to Print vs Say with sleep function

Just changing Example 2 to this should give you the same result as with say:
$ perl -e 'use v5.10;for (1..10) {print "$_\n"; sleep(1);}' 1 2 3 4 5 6 7 8 9 10
It is not even needed to deactivate buffering and change $|, since printing to STDOUT is line buffered (i.e. the buffer is flushed as soon as a newline character is found).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-24 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found