in reply to RE: Cropping Elements in an Array
in thread Cropping Elements in an Array

Go one step further:
for (@yourarray) { my @ary = (split/ /, $_, 5)[0 .. 4]; }
or even the also untested:

@yourarray = map { join(" ", (split(/ /, $_))[0 .. 4]) } @yourarray;

Replies are listed 'Best First'.
RE: RE: RE: Cropping Elements in an Array
by agoth (Chaplain) on Nov 02, 2000 at 21:40 UTC

    I was trying to avoid the slice of the first few, I don't know why ;-), I fancied lopping two items off the end.
    too lazy to use splice......
    splice(@ary, -2);