my $item; while (defined($item = shift @array)){ print $item, "\n"; }
This destroys @array, though.
BTW there is no PERL, just perl (the interpreter) and Perl (the language)
Update: made 0-safe
In reply to Re: Printing an array using while loop
by moritz
in thread Printing an array using while loop
by knapper19954
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |