>>>>> "Helen" == alhma <alhma@attme.cnet.att.com> writes:
Helen> Soooo...,
Helen> is there an easy routine I can add to Majordomo to see
Helen> these two addresses as equivalent? I'm reading my way
Helen> through the Perl programming book (the camel book) for the
Helen> first time. Seems like there should be a way.
Helen> List subscriber From address abcde!user =
Helen> user@abcde3.xyz.zzz.com
How about the following:
#!/usr/bin/perl
sub translate_address
{
local($address, $domain_suffix) = @_;
# separate machine name & user name from UUCP address
local($machine, $user) = split('!', $address, 2);
# form new address from user name, machine name, and
# domain suffix
$user . '@' . $machine . $domain_suffix;
}
# presumably you won't have the address hard-coded,
# but read in from the unsub request
$addr = "abcde!user";
# this is the domain you'd like to append
$dom = "3.xyz.zzz.com";
# display UUCP style address
printf "the old address is: $addr\n";
# display translated address
printf "the new address is: %s\n",
&translate_address($addr, $dom);
Although not particularly clever, the above routine does do the job.
If you'd like more ideas, check out the other Perl book from ORA,
entitled _Learning Perl_. It seems to have more examples than the
Camel book, but the Camel book you should have around for reference
anyway.
Hope this helps...
--
Dario Alcocer
alcocer@pino.connectnet.com
References:
|
|