Hi,

I just spent 20mins scratching my head because I didn't read the docs
very closely concerning splice. I had assumed it left the array
intact, its doesn't. I was hoping for a function more akin to substr
where the return would be the offset -> length of the array but the
value it was working on remained in tact.

@array = (1, 4, 6, 9, 2);
my @list = splice(@array, 1, 3);        # @list = (1, 4, 6) and @array =(9,2)

It doesn't say but do indexes start with 0 with splice?

Is there a List::Util or similar that might meet my needs? Or do I
simple push the values back once I've used splice?
push(@array, @list);

TIA,
Dp.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to