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

You can change your loop code to be as follows:
for($i = 0; $i < @contents; $i++){ if($contents{$i] =~ m/manager\.(\d*)\.address=(\d*\.\d*\.\d*\.\d +*)/) { if($address eq "$2"){ print "manager.$1.address=$2\n"; print " exist at index $i\n"; } } }
-albert

Update: editing the suggestion for the lack of $_ in the solution. Untested code, your mileage may vary.