Thank you for your input !
I just started learning Perl yesterday, so the "state machine type approach" is still new to me. I just want to add that I need to store the $2 in a variable because I then add it to a database.
I also run into another problem : the loop skips the second round of entries as there are a bunch of "/Relay.access.denied/" in the file. Which I'm guessing is because the "<>" already goes through it at the end of the nested loop.
So my question is, is there a way to tell <> to go back one line at the end of the loop.