in reply to Printing an array using while loop
Also, I'm assuming that this is homework.@array = qw(ball bat helmet)
Here's a hint: while(@array) tests the current length of the array. That means you will get an endless loop, but only if the array never changes.
You may want to take a look at perlfunc's section "Functions for real @ARRAYS"
updated: removed commas from qw() list. thanks liverpole.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Printing an array using while loop
by downer (Monk) on Oct 21, 2007 at 20:52 UTC | |
by chromatic (Archbishop) on Oct 21, 2007 at 21:10 UTC | |
|
Re^2: Printing an array using while loop
by Anonymous Monk on Oct 07, 2018 at 20:19 UTC | |
by haukex (Archbishop) on Oct 07, 2018 at 20:40 UTC |