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) {
>    if (defined $array0[0]) { #accept 0 as a valid item
>       push(@array1, shift @array0);
>       }
> }

Do you want splice?

  @array1 = splice @array0, 0, 100;

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

Reply via email to