Charles K. Clarkson wrote:
Harold Castro [EMAIL PROTECTED] wrote:
: my $countdown = 5;
: while ($countdown 0){
: print \.;
No need to escape the period in a double quoted string.
: sleep 1;
: $countdown--;
: }
: print Kaboom!!
:
: And the result..
: after waiting for 5 seconds, it displayed
Mark Jayson Alvarez [EMAIL PROTECTED] asked:
[...]
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?
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
-Original Message-
From: Harold Castro [mailto:[EMAIL PROTECTED]
Sent: Mon 2/21/2005 9:42 AM
To: beginners@perl.org
Cc:
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
Harold Castro [EMAIL PROTECTED] wrote:
: my $countdown = 5;
: while ($countdown 0){
: print \.;
No need to escape the period in a double quoted string.
: sleep 1;
: $countdown--;
: }
: print Kaboom!!
:
: And the result..
: after waiting for 5 seconds, it displayed this line at once:
:
:
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
On Monday 21 Feb 2005 04:08, Mark Jayson Alvarez wrote:
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
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