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;