in reply to Can I do this?

That should work, but consider:

$j = 23; $i = $j; LOOP: while (1) { if ($index[$i] eq 'blah') { last LOOP; } elsif ($i == $#array) { $i = 0; } else { $i++; } )


Update: added missing closing quote.

Second update: per wog noted that you actually "start over" at 1, because next performs the $i++. However, I think you want to start at the beginning of the array, right? If not, change the code to:

$j = 23; $i = $j; LOOP: while (1) { if ($index[$i] eq 'blah') { last LOOP; } elsif ($i == $#array) { $i = 0; } $i++; )