in reply to Re^2: Array searching, grep, first
in thread Array searching, grep, first

You are quite right. grep will search through the entire list on every iteration. first is the way to go but your looping through the indexes is more self explanatory.