MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

RE: Email parsing



******    message to minivend-users from Ryan Hertz <rhertz@gyb.baits.com>     ******

>From line 708- of lib/Vend/Order.pm:

sub _email {
        my($ref, $var, $val) = @_;
        if($val and $val =~ /\w+@[-A-Za-z0-9.]+\.[A-Za-z]+/) {
                return (1, $var, '');
        }
        else {
                return (undef, $var, "$val not an email address");
        }
}

The module Email::Valid will either fail an address (return undef),
"correct" it and pass, or pass.  I can't seem to determine how to change
the value of the email address passed to sub _email in the event of a
corrected address.

sub _email {
        my($ref, $var, $val) = @_;
        $addr = Email::Valid->address($val);
        if($addr) {
                # need to set minivend customer's email address to $addr in
case of change
                return (1, $var, '');
        }
        else {
                return (undef, $var, "$val not an email address");
        }
}



Ryan Hertz                                              tel  520-645-3812
Webmaster                                               tel  800-645-BAIT
Advertising Director                                    fax  520-645-2588
Gary Yamamoto Custom Baits, Inc.            http://www.yamamoto.baits.com
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: