Are you using it as a command line tool or as CGI etc??

Manav

-----Original Message-----
From: Mallik [mailto:[EMAIL PROTECTED]
Sent: Monday, February 21, 2005 1:12 PM
To: beginners@perl.org
Cc: 'Manav Mathur'; 'Mark Jayson Alvarez'
Subject: RE: Perl waits for while to finish before printing if on
thesameline,why?(countdown prog)


Still the result is same.

-----Original Message-----
From: Manav Mathur [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 21, 2005 1:11 PM
To: Mark Jayson Alvarez; beginners@perl.org
Subject: RE: Perl waits for while to finish before printing if on the
sameline,why?(countdown prog)




Try this

my $countdown = 5;
local $|=1 ;
while ($countdown > 0){
print "\.";
sleep 1;
$countdown--;
}
print "Kaboom!!"
-----Original Message-----
From: Mark Jayson Alvarez [mailto:[EMAIL PROTECTED]
Sent: Monday, February 21, 2005 9:39 AM
To: beginners@perl.org
Subject: Perl waits for while to finish before printing if on the same
line,why?(countdown prog)


Hi,
  I'm new to perl and i'm trying to create a simple
program that will act like a time bomb but will print
a dot(something like a progress bar every second until
the specified time arrives. Here's my code.

my $countdown = 5;
while ($countdown > 0){
print "\.";
sleep 1;
$countdown--;
}
print "Kaboom!!"

And the result..
after waiting for 5 seconds, it displayed this line at
once:

.....Kaboom!!


Why does this happens with a while loop? I told it to
print a single dot every 1 second. Do you know another
way of making my progress bar program that display a
single dot every one second on the same line until it
reaches a given time?

Thank you!








                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



*********************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s)
or attachment(s) if any) are privileged and confidential material of MBT
and should not be disclosed to, used by or copied in any manner by
anyone other than the intended addressee(s).   In case you are not the
desired addressee, you should delete this message and/or re-direct it to
the sender.  The views expressed in this E-mail message (including the
enclosure(s) or attachment(s) if any) are those of the individual
sender, except where the sender expressly, and with authority, states
them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be
free of any virus.  However, it is the responsibility of the recipient
to ensure that it is virus free and MBT is not responsible for any loss
or damage arising in any way from its use

*********************************************************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


*********************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or 
attachment(s) if any) are privileged and confidential material of MBT and 
should not be disclosed to, used by or copied in any manner by anyone other 
than the intended addressee(s).   In case you are not the desired addressee, 
you should delete this message and/or re-direct it to the sender.  The views 
expressed in this E-mail message (including the enclosure(s) or attachment(s) 
if any) are those of the individual sender, except where the sender expressly, 
and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of 
any virus.  However, it is the responsibility of the recipient to ensure that 
it is virus free and MBT is not responsible for any loss or damage arising in 
any way from its use

*********************************************************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to