Re: shifting 100 at a time

2006-08-20 Thread Gerald Host
Yes! I just wasn't sure if I'd get undefs in my array or not (I don't). Thanks! On 8/20/06, Tom Phoenix <[EMAIL PROTECTED]> wrote: On 8/20/06, Gerald Host <[EMAIL PROTECTED]> wrote: > No. I want the most efficient way to do this: > my @array0=(0..1000); > my @array1; > for (0..100) { >

Re: shifting 100 at a time

2006-08-20 Thread Tom Phoenix
On 8/20/06, Gerald Host <[EMAIL PROTECTED]> wrote: 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); } } Do you want splice? @array1 = splice @array0

Re: shifting 100 at a time

2006-08-20 Thread Gerald Host
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 (

Re: shifting 100 at a time

2006-08-20 Thread Xavier Mas i Ramón
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 com

shifting 100 at a time

2006-08-20 Thread Gerald Host
What is the most efficient way to shift the first 100 items off an array? Thanks!