Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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??

Help for this page

Select Code to Download


  1. or download this
    while ($get_gal =~ m#(http://{...}.jpg)#g) {
       my $image = get($1);
    ...
       push @found_images, $1
          if $height <= $max_height and $width <= $max_width;
    }
    
  2. or download this
    while ($get_gal =~ m#(http://{...}.jpg)#g) {
       my $image = get($1);
    ...
       next if $height > $max_height or $width > $max_width;
       push @found_images, $1;
    }
    
  3. or download this
    my @found_images =
       grep { my $image = get($_);
              my ($height, $width) = imgsize(\$image);
              $height <= $max_height and $width <= $max_width }
       $get_gal =~ m#(http://{...}.jpg)#g;
    
  4. or download this
    sub is_image_size_ok {
       local $_ = @_ ? $_[0] : $_;
    ...
    my @found_images = grep is_image_size_ok,
                       map m#(http://{...}.jpg)#g,
                       $get_gal;
    

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 scrutinizing the Monastery: (9)
As of 2024-03-28 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found