I'm hesitant to bring another module into this. I don't want to make it any more complicated than it needs to be.
Mathew Adriano Ferreira wrote: > On 2/2/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: >> I have a script which extracts email addresses from a web page, pushes >> them into >> an array and then prints them out before asking if I wish to perform >> the work on >> them that is required. >> >> What I would like to do is compare the username portion of the email >> address to >> a list of usernames in a hash to determine if the email address should be >> skipped. I just don't know how to write out the regex for that. The >> line I >> have so far is >> push @emails, $email if $email =~ m/[EMAIL PROTECTED]/gmx unless ($email =~ >> m/^ >> >> I don't know how to further this to accomplish what I need. Can >> someone please >> help. > > Be lazy. Use Email::Address to take care of the parsing of the e-mail > addresses and many subtleties in the specification you even didn't > want to know about. > > use Email::Address; > my $addr = Email::Address->new(undef, '[EMAIL PROTECTED]'); > my $user = $addr->user; # this is "casey" > > Regards, > Adriano Ferreira. > >> >> Thanks, >> Mathew >> >> -- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> http://learn.perl.org/ >> >> >> > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/