in reply to email domain changing

You should read more about this, you can solve it with what is called a RegEx as for Regular Expression:

let's assume you know how to read the lines into an array and iterate over it, all you need to do is substitute s/// the abc into xyz:

ex:

while (<DATA>) { 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.
Update: this could chew user abcd@abc.com, so here's a fix
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]


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/

Replies are listed 'Best First'.
Re: Re: email domain changing
by Anonymous Monk on Jul 12, 2001 at 18:23 UTC
    A quick extension to Chady's regex.
    Just to make sure that you're only changing the domain use look ahead and look behind assertations
    Otherwise abc@abc.com would become xyz@xyz.com
    s/(?<=\@)abc(?=\.)/xyz/g
Re: Re: email domain changing
by james8288 (Initiate) on Jul 12, 2001 at 18:23 UTC
    thanks, how do I send the new email addresses as well as the old ones (we need to keep 'em for the transition period) as standard input to an OS command..