Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: lovely regexs

by Cody Pendant (Prior)
on Apr 12, 2009 at 23:19 UTC ( #757138=note: print w/ replies, xml ) Need Help??

in reply to lovely regexs

Just in case this hasn't occurred to you, there are other things in HTML which have a src attribute.

Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...

Comment on Re: lovely regexs
Download Code
Replies are listed 'Best First'.
Re^2: lovely regexs
by CountZero (Bishop) on Apr 13, 2009 at 12:54 UTC
    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 = ''; $extor->parse_url($url); foreach my $src ( $extor->img ) { print "$src\n"; }


    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?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2015-11-30 13:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (771 votes), past polls