in reply to Manipulating Array Indexes
If you want array elements, why do you use pop ? This modifies the array in question...
Maybe you can show us your code that "almost" works and tell us how it fails for you.
The simplest approach to get the next three items after a given index I can think of is:
use feature 'signatures'; sub next_three_items( $array_ref, $index ) { return $array_ref->[$index+1], $array_ref->[$index+2], $array_ref->[$index+3], ; }
... but maybe I have not understood your requirements well...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Manipulating Array Indexes
by perlfan (Parson) on Sep 07, 2020 at 16:36 UTC |