this for loop works:
for(my $i=0; $i <= 10000; $i++) {
print "$windmill[$i % 4]\r";
usleep(50000);
}
I changed the $_ to $i...
Tyler
----- Original Message -----
From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]>
To: "Tyler Longren" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 10, 2001 9:19 AM
Subject: Re: timer/display
> On Jul 10, Tyler Longren said:
>
> >#!/usr/bin/perl -w
> >use strict;
> >$| = 1;
> >use Time::HiRes qw(usleep);
> >my @windmill=("\\", "|", "/", "-");
> >for(my $i=0; $i <= 10000; $i++) {
> > print "$windmill[$_ & 3]\r";
> > usleep(50000);
> >}
> >
> >I get this error:
> >Use of uninitialized value in bitwise and (&) at ./test.pl line 7.
>
> Your for loop uses $i... and your & expression uses $_.
>
> I'd rewrite the for loop as
>
> for (0 .. 10_000) { ... }
>
> anyway.
>
> --
> Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
> I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
> Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
> Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
> Acacia Fraternity, Rensselaer Chapter. Brother #734
> ** Manning Publications, Co, is publishing my Perl Regex book **