Great Circle Associates Majordomo-Users
(November 1995)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Equivalent but not exactly equal addresses
From: pino!alcocer @ connectnet1 . connectnet . com (Dario Alcocer)
Date: Fri, 10 Nov 1995 17:01:23 -0800
To: alhma @ attme . cnet . att . com
Cc: majordomo-users @ greatcircle . com
>received: by pino.connectnet.com (8.6.9/1.34)id RAA17465; Fri, 10 Nov 1995 17:01:23 -0800
In-reply-to: <30a2065a0.2d75@muffin.attme.cnet.att.com>
References: <30a2065a0.2d75@muffin.attme.cnet.att.com>

>>>>> "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:
Indexed By Date Previous: Re: Archive problem
From: Dale Cook <cdm@hyperk.com>
Next: Are You Preapred?
From: Peter Quizert <peterqz@primenet.com>
Indexed By Thread Previous: Equivalent but not exactly equal addresses
From: alhma@attme.cnet.att.com
Next: Are You Preapred?
From: Peter Quizert <peterqz@primenet.com>

Google
 
Search Internet Search www.greatcircle.com