Perl error --> Global symbol requires...

From: Bret Goodfellow (Bret.Goodfellow_at_questar.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 15:55:21 -0700
To: <beginners@perl.org>

I'm getting the following error in my code. If I define $i as my $i
then everything works fine. What's wrong?
 
# while1.pl
use strict ;
use warnings ;
 
$i = 1;
 
while ($i < 10) {
 print "I am at $i\n";
 i++;
}
# while1.pl
 
 
 
Global symbol "$i" requires explicit package name at
C:\BegPerl\while1.pl line 6



Relevant Pages