Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: How to extract an email address from a mailto URL?

by jdlev (Scribe)
on Dec 30, 2008 at 13:17 UTC ( #733238=note: print w/replies, xml ) Need Help??


in reply to Re: How to extract an email address from a mailto URL?
in thread How to extract an email address from a mailto URL?

My experience in perl is going on about 3 weeks...so some of what you are saying is greek to me. Can you provide an example of how you would do it? The source file to pull the information from has the tag as follows:

showTollfree(1010)
// -->
'/script'
Fax:  (301)931-1285 
'br''a
href='mailto:KHargrove@servpro1010.com'>KHargrove@servpro1010.com'/a'

'/td'

I'm sorry to have to be wet nursed through this...but I have learned a ton of stuff over the last few weeks...I feel like my brain is going to explode!

  • Comment on Re^2: How to extract an email address from a mailto URL?

Replies are listed 'Best First'.
Re^3: How to extract an email address from a mailto URL?
by linuxer (Curate) on Dec 30, 2008 at 14:07 UTC

    Well, first install these two modules (and their unresolved dependencies if there are any):

    Then you can do something like this (Quickshot, untested):

    #!/usr/bin/perl use strict; use warnings; use Regexp::Common qw(Email::Address); use Email::Address; my $filename = 'file_to_parse.dat'; open my $rh, '<', $filename or die "$filename: $!"; # Requirement: href=, mailto: and the mailaddress must be in the same +line! my @addresses = map { m/mailto:($RE{Email}{Address})/o; $1 } grep { m/href=.+?mailto:/ } <$rh> ; close $rh; { local $, = local $\ = "\n"; print @addresses; } __END__
      Thanks, works great!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://733238]
help
Chatterbox?
[1nickt]: Ah, I see. I did read some gamer mag reviews, and yes, they lamented the fact that laptops with no discrete video card are sold as "gaming" hardware.
[1nickt]: But, they do have red keyboard backlighting! And gargoyles on the front, or words like "Maxxx" here and there. They know their demographic!
[1nickt]: True gamers don;t buy Dells, HPs, or Lenovos, I think ;-)
[ambrus]: The keyboard I bought doesn't have backlighting. I specifically had to select for that, because so many keyboards these days have lights. Why would I want lights in the keyboard? I want lights in the room, such as on the ceiling, not in the keyboard.
choroba has a small USB lamp
[ww]: ++ all (phony labels re "gaming"
[1nickt]: ambrus perhaps you know where the keys are?

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (14)
As of 2017-03-27 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.