in reply to Re^2: getting headers from essage
in thread getting headers from essage

Thanks, actually it can get much more complicated tho

https://en.wikipedia.org/wiki/Email_address

I think there should° be a module dedicated to parse a list of email addresses.

Doing this manually smells like trying to parse HTML with a regex.

UPDATE

°) Yep, see Email::Address on CPAN (unexpected name ;-)

my @addrs = Email::Address->parse( q[me@local, Casey <me@local>, "Casey" <me@local> (West)] );

and from the description

ACHTUNG! Email isn't easy (if even possible) to parse with a regex, at least if you're on a perl prior to 5.10.0. Providing regular expressions for use by other programs isn't a great idea,

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery