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

2005-02-25 Thread JupiterHost.Net
Owen wrote: On Fri, 25 Feb 2005 15:55:21 -0700 "Bret Goodfellow" <[EMAIL PROTECTED]> 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 w

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

2005-02-25 Thread John W. Krahn
Owen wrote: On Fri, 25 Feb 2005 15:55:21 -0700 "Bret Goodfellow" <[EMAIL PROTECTED]> 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 w

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

2005-02-25 Thread Xiaofang Zhou
Hi, Bret You must tell perl what kinds of var the $i is, when 'use strict'. $i can be a lexical var or a global var. my $i = 1; # $i is a lexical var. our $i = 1; # $i is a global var, perl 5.6+ only. use vars qw($i); # also as global var, but can work under old perl 在 2005-02-25 15:55:00

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

2005-02-25 Thread Owen
On Fri, 25 Feb 2005 15:55:21 -0700 "Bret Goodfellow" <[EMAIL PROTECTED]> 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 t

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

2005-02-25 Thread John W. Krahn
Bret Goodfellow wrote: I'm getting the following error in my code. If I define $i as my $i then everything works fine. What's wrong? perldoc -q "When I tried to run my script, I got this message. What does it mean" # while1.pl use strict ; use warnings ; $i = 1; while ($i < 10) { print "I

Perl error --> Global symbol requires...

2005-02-25 Thread Bret Goodfellow
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\wh