in reply to for loop

Typo:

- if ($ipfconts[$x] =~/$remote_addr}/){ + if ($ipfconts[$x] =~/$remote_addr/){

Update: To clarify, the right paren inside // appears to be extraneous (unless that's a feature of your data file and intended). Props to crazyinsomniac.

After Compline,
Zaxo