in reply to Shuckin' the Email Addy

Note that the perlfaq correctly notes that there is no simple regex to match an RFC-822 compliant e-mail address. Please note this!

With that in mind, if your data file is as simple as what you say, I would do something like this:

(undef, $address, undef) = split '', $line;

I wouldn't bother with trying to match anything else, I'd just split. Again, this depends on your text file being *very* simple, as simple as you've described it above.

For anything else, the modules Email::Find and Email::Valid might come in handy.

Replies are listed 'Best First'.
RE: Re: Shuckin' the Email Addy
by Fastolfe (Vicar) on Sep 07, 2000 at 17:14 UTC
    There is a module EMail::Find specifically for searching text for e-mail addresses. I don't know how well it works. It does come with RFC822 validation code (Email::Valid, mentioned elsewhere), though. There is also a module RFC::RFC822::Address that checks (strictly) for the validity of an RFC822 e-mail address.
RE: Re: Shuckin' the Email Addy
by Anonymous Monk on Sep 07, 2000 at 06:53 UTC
    chromatic, that is exactly what I need!

    Thanks.

    By the way, you're advisory about trying to validate e-mail addresses is well-taken, but the format of the source file is pretty simple so your split idea should fit the bill.

    Thanks again.