Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^5: adding an IF to a push

by ikegami (Patriarch)
on Jun 28, 2006 at 06:01 UTC ( [id://557937]=note: print w/replies, xml ) Need Help??


in reply to Re^4: adding an IF to a push
in thread adding an IF to a push

Two reasons:

  • You don't have any captures in your regexp, so $1 is never given a value.

  • The do is executed before the match. The match might not be executed at all, depending on the value returned by do.

Fix:

while ($get_gal =~ m#(http://{...}.jpg)#g) { my $image = get($1); my ($height, $width) = imgsize(\$image); push @found_images, $1 if $height <= $max_height and $width <= $max_width; }

Bunch of alternative styles:

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found