http://www.perlmonks.org?node_id=1054786


in reply to Regex being stupid

I'm really too tired to take a crack at this (being awake only because of a roll-out that happened at 00:00) but if it can be guaranteed that the potential email address will always be the first element before a whitespace in a give input line then you might try this:

my ($email,$foo) = split(/\s/,$text,2);

You could then use any number of tools to see if $email is actually a potentially reasonable representation of an email address.