Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: lovely regexs

by CountZero (Bishop)
on Apr 13, 2009 at 12:54 UTC ( [id://757204]=note: print w/replies, xml ) Need Help??


in reply to Re: lovely regexs
in thread lovely regexs

Indeed and the $extor->src method returns them all. Fortunately there is another method $extor->img that returns the src attribute of the img links only.
use strict; use warnings; use HTML::SimpleLinkExtor; my $extor = HTML::SimpleLinkExtor->new(); my $url = 'http://www.perlmonks.org'; $extor->parse_url($url); foreach my $src ( $extor->img ) { print "$src\n"; }
Output:
http://promote.pair.com/i/pair-banner-current.gif http://perlmonks.org/images/monkpics/pater_hat_sm.gif

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://757204]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found