Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
When the below script is executed,
sleep command is executed first and only after that the print statements are executed though they are present before the sleep command given . what might be the reason for this strange behaviour ????
thanks in advance!!!
#! /usr/bin/perl -w print "First line of the script"; print "Second line of the script"; $time = 5; while($time > 0) { sleep (5); $time--; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Problem with sleep command in perl
by choroba (Cardinal) on Aug 03, 2012 at 08:34 UTC | |
by Anonymous Monk on Aug 03, 2012 at 08:35 UTC | |
Re: Problem with sleep command in perl
by bulk88 (Priest) on Aug 03, 2012 at 15:50 UTC |
Back to
Seekers of Perl Wisdom