No.  I want the most efficient way to do this:
my @array0=(0..1000);
my @array1;
for (0..100) {
  if (defined $array0[0]) { #accept 0 as a valid item
     push(@array1, shift @array0);
     }
}

I want to stop at the end of the @array0 too, so if it only had 20 items in
it I would break the loop (assuming a loop is even used.)

Thanks!


On 8/20/06, Xavier Mas i Ramón <[EMAIL PROTECTED]> wrote:

A Diumenge 20 Agost 2006 22:49, Gerald Host va escriure:
> What is the most efficient way to shift the first 100 items off an
array?
>
> Thanks!

if you mean that first element be the last one and so on, use reverse.

--
Xavier Mas

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Reply via email to