camo has asked for the wisdom of the Perl Monks concerning the following question:

hi there, i use this codelines to extract adress from a email:
@from_addresses = Mail::Address->parse($from); my $address; if (@from_addresses) { $from = $from_addresses[0]->address(); } else {exit;}
this work already good but if i have a sender with email-address like this:
mike miky [mike(at)mike.bla]
(*i replace @ with (at)) then i get only back:
mike
i have no idea how to handle this problem! thanks

Replies are listed 'Best First'.
Re: Handle Adress from eMail
by neilwatson (Priest) on Feb 28, 2005 at 21:11 UTC
    An obfuscated mail is a good sign that this person does not want you to be gathering his or her address. He or she fears you might be up to no good.

    Neil Watson
    watson-wilson.ca

Re: Handle Adress from eMail
by esskar (Deacon) on Feb 28, 2005 at 20:33 UTC
Re: Handle Adress from eMail
by sh1tn (Priest) on Feb 28, 2005 at 21:09 UTC
    As far as I see you mean deobfuscation. Obfuscated variants are
    (almost) infinite hence you cannot compute in one easy step what is
    and what's not valid e-mail address.
    # one poor decision $_ = 'mike miky [mike [-( at )-] mike.bla]'; /(\w+) \W+ at \W+ (\w+(?:\.\w+)+)/i; print "$1\@$2" # prints mike@mike.bla