Re: Extract user from email address

2007-02-08 Thread Mathew Snyder
Email::Address1 was a mis-type which I discovered when I tried to run the script. The reason why the two tripwire users are separate is that they aren't *real* users of the system but need to be weeded out anyway. I was actually looking at that extra check and figured it was a bit redundant. Tha

Re: Extract user from email address

2007-02-08 Thread Adriano Ferreira
On 2/8/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: Does this look like it *should* work? while ($data->get_tag("small")) { my $email = $data->get_trimmed_text("/small"); my $addr= new Email::Address1(undef, $email); What's this Email::Address1 ? my $add

Re: Extract user from email address

2007-02-07 Thread Mathew Snyder
Does this look like it *should* work? while ($data->get_tag("small")) { my $email = $data->get_trimmed_text("/small"); my $addr= new Email::Address1(undef, $email); my $addrUser= $addr->user; if ($email =~ m/^ids-tripwire/gmx or $email =~ m/^tripwi

Re: Extract user from email address

2007-02-06 Thread Dr.Ruud
Chad Eldridge schreef: > As to disadvantages to Email::Address, I can't see any. It's not a > matter of disadvantage, I just prefer to write the code myself when I > can. Mostly this comes just from curiousity. So, it's really more > preference than a matter of advantage. I'm not going to try and

Re: Extract user from email address

2007-02-06 Thread Jay Savage
On 2/5/07, Chad Eldridge <[EMAIL PROTECTED]> wrote: [snip] > But using Email::Address would have got it right in the first place, and > I still > can't see what the disadvantage is. > > HTH, > > Rob You are right about that code I posted, I'm sorry about that. I was thrown together in a hurry wh

Re: Extract user from email address

2007-02-06 Thread Randal L. Schwartz
> "Chad" == Chad Eldridge <[EMAIL PROTECTED]> writes: Chad> As to disadvantages to Email::Address, I can't see any. It's not a Chad> matter of disadvantage, I just prefer to write the code myself when I Chad> can. Mostly this comes just from curiousity. So, it's really more Chad> preference th

Re: Extract user from email address

2007-02-06 Thread Mathew
Chad Eldridge wrote: > Rob Dixon wrote: >> Chad Eldridge wrote: >> > >>> Mathew wrote: >> >> 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 ar

Re: Extract user from email address

2007-02-05 Thread Chad Eldridge
Rob Dixon wrote: Chad Eldridge wrote: > Mathew wrote: >> 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

Re: Extract user from email address

2007-02-03 Thread Dr.Ruud
Rob Dixon schreef: > [academica] > my ($user) = ($email =~ /(.+?)[EMAIL PROTECTED]/); > > which would put the part of the email up to the 'at' sign into $user. > But there's no need to match anything after the at, so you could write > > my ($user) = ($email =~ /(.+?)\@/); Email addresses can hav

Re: Extract user from email address

2007-02-02 Thread Rob Dixon
Chad Eldridge wrote: > Mathew wrote: >> 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 th

Re: Extract user from email address

2007-02-02 Thread Chad Eldridge
I usually try and use as few modules as possible as well, especially for simple tasks. I would suggest something like this maybe... Assuming %Skip is your hash of users to skip over... my ($user) = ($email =~ /[EMAIL PROTECTED]/); unless ($Skip{$user}) { push(@emails,$email); } Hope this he

Re: Extract user from email address

2007-02-02 Thread Jay Savage
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

Re: Extract user from email address

2007-02-02 Thread Tom Phoenix
On 2/2/07, Mathew <[EMAIL PROTECTED]> wrote: I'm hesitant to bring another module into this. I don't want to make it any more complicated than it needs to be. Actually, using the module makes your work less complicated, not more. Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubsc

Re: Extract user from email address

2007-02-02 Thread Mathew
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 arra

Re: Extract user from email address

2007-02-02 Thread Adriano Ferreira
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

Extract user from email address

2007-02-01 Thread Mathew Snyder
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