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) {
>
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
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 (
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
What is the most efficient way to shift the first 100 items off an array?
Thanks!