while () { s/abc/xyz/ig; # The way this is constructed: it takes # the value in the first set of / / and # replaces it with the value in the next # set. #### s/\@abc\.com/\@xyz\.com/ig; } __DATA__ SMTP-Address: [user@abc.com] [user-1@abc.com] [user-2@abc.com] SMTP-Address: [anotheruser@abc.com] [anotheruser-1@abc.com] [anotheruser-2@abc.com]