boltman has asked for the wisdom of the Perl Monks concerning the following question:

Hola-
Last night I was trying to run a perl script that I had been running on a W2k machine with ActivePerl (5.6.1) on my Linux box. I ran into a problem which I have distilled into the following example.
print "hello"; sleep 2; print "goodbye";
on my Linux box (using perl 5.6) My output is:
hellogoodbye <wait for 2 seconds>
where I would expect
hello<wait for 2 seconds>goodbye
Now, if I change the script to (only adding \n):
print "hello\n"; sleep 2; print "goodbye";
I get the expected result of:
hello <wait 2 seconds> goodbye
On my Win2k box, both scripts give the expected results. What's happening here?
Thanks!

Replies are listed 'Best First'.
(jeffa) Re: Sleep behavior across platforms
by jeffa (Bishop) on Mar 22, 2002 at 17:57 UTC
Re: Sleep behavior across platforms
by perrin (Chancellor) on Mar 22, 2002 at 18:57 UTC
    I've slept on both Windows and Linux, and I definitely preferred the soft cushion provided by the Windows manual, though the CD-ROM dug into my back a little. However, if you print out the man pages that come with Linux they will keep you warm. Overall, I would say sleeping on either one is fairly pleasant.