seaver has asked for the wisdom of the Perl Monks concerning the following question:
the list in @Nos being (11,14,19...) i only get 11, 19, because whilst I've shifted a number, the loop's array indice is still 1, so it ignores 14, as 14 becomes [0].foreach my $No (@Nos){ push(@String, $Chains{$chain}{$No}) ; $prevNo = $No; shift(@Nos); print "@Nos\n"; }
any better way of doing this?
Thanks
Sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: resetting a loop
by jmcnamara (Monsignor) on Sep 10, 2002 at 15:24 UTC | |
|
Re: resetting a loop
by seaver (Pilgrim) on Sep 10, 2002 at 15:19 UTC |