aquarium has asked for the wisdom of the Perl Monks concerning the following question:
i get use of uninitialized value and it prints three lines of zero. I've played a bit more with this putting "our" inside the loop, but that only works if i print @array--not $array[$cnt]. it looks like vars are going out of scope magically. where to look in this install / Win2000 Server setup to fix this? Chrisuse strict; use warnings; my @array = qq(bla bla2 bla3); for ( my $cnt = 0; $cnt<=@array; $cnt++) { print $array[$cnt]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: vars going out of scope!
by Abigail-II (Bishop) on Apr 23, 2003 at 00:54 UTC | |
by aquarium (Curate) on Apr 23, 2003 at 01:04 UTC | |
by JamesNC (Chaplain) on Apr 23, 2003 at 02:33 UTC | |
by aquarium (Curate) on Apr 23, 2003 at 09:56 UTC | |
|
Re: vars going out of scope!
by slife (Scribe) on Apr 23, 2003 at 09:58 UTC | |
|
Re: vars going out of scope!
by aquarium (Curate) on Apr 23, 2003 at 00:50 UTC |