in reply to Send Array to Subroutine, Three Elements at a Time
isn't really right, because what if the first element of @array is undef itself? You wanted this:push @array_segment, shift @array if defined $array[0];
That's also more idiomatic, because you're saying "if there are more elements in the array" rather than "if the first element is undef".push @array_segment, shift @array if @array;
But the splice is the way to go.
xoxo,
Andy
|
|---|