Re: Perl error --> Global symbol requires...

From: Owen (rcook_at_pcug.org.au)
Date: 02/26/05


Date: Sat, 26 Feb 2005 16:41:24 +1100
To: beginners@perl.org

On Fri, 25 Feb 2005 15:55:21 -0700
"Bret Goodfellow" <Bret.Goodfellow@questar.com> wrote:

> # 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

Try removing the 'use strict;' statement. See what happens

You also have another problem with that script, perhaps i++ was a typo?

Owen



Relevant Pages