in reply to Printing an array using while loop
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Printing an array using while loop
by Sidhekin (Priest) on Oct 21, 2007 at 20:31 UTC | |
Re^2: Printing an array using while loop
by Joost (Canon) on Oct 21, 2007 at 20:29 UTC | |
by moritz (Cardinal) on Oct 21, 2007 at 20:30 UTC | |
Re^2: Printing an array using while loop
by ikegami (Patriarch) on Oct 22, 2007 at 05:58 UTC | |
Re^2: Printing an array using while loop
by naikonta (Curate) on Oct 23, 2007 at 16:23 UTC | |
Re^2: Printing an array using while loop
by Anonymous Monk on Jan 12, 2017 at 13:59 UTC | |
by hippo (Bishop) on Jan 12, 2017 at 15:05 UTC |
In Section
Seekers of Perl Wisdom