[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT?] sleep()-problem in perl



Hello Everybody
Could someone tell me why this works:

#!/usr/bin/perl -w
for ($i=0;$i<=10;$i++){
  print "sleeping...\n";
  sleep 1;
}
 
and this one does not:

#!/usr/bin/perl -w
for ($i=0;$i<=10;$i++){
  print "sleeping...";
  sleep 1;
}

Note: Only the newline inside the print-command is missing. The first
example works as expected (prints one line of "sleeping..." per second), while the
second example does nothing (not even prints the "sleeping..." before sleep()
is called).
The behaviour does not change if I try single quotes instead of double
quotes, and not if I write brackets around the print argument.
This happens on woody perl, I could not yet try it out on sid.
Any idea?

joerg

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!



Reply to: