in reply to to find an index of a particular value in an array

Zaxo suggested a particularly neat way to get all the lines containing the address you want. Which is indeed what I'd look for too. But if you really want the index instead, just change that code to
my @indexes = grep { -1 != index $contents[$_], $address } 0..$#conten +ts;
Of course this is much less neat, but then you may adapt any of these techniques to your own needs...