in reply to Re: Array manipulation how to
in thread Array manipulation how to

$index = ($index + $dir) % @array;

Or:

( $index += $dir ) %= @array;