in reply to Manipulating Array Indexes

I recommend using indexes of List::MoreUtils to get the indexes and an array slice (Slices) to get the values.
use strict; use warnings; use List::MoreUtils qw(indexes); my @list = qw(1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1); my $target = 5; my @indexes = indexes {$_ == $target} @list; my @values = map {[@list[($_+1)..($_+3)]]} @indexes; print "@$_\n" foreach @values;

OUTPUT:

6 7 8 4 3 2
Bill