Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^5: adding an IF to a push

by ikegami (Patriarch)
on Jun 28, 2006 at 05:15 UTC ( [id://557929]=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

Change
if (\%add($num) { .. }
to
if (add($num)) { .. }

In context, it would actually be:

sub is_image_size_ok { my ($image) = @_; my $img = get($image); my ($height, $width) = imgsize(\$img); return $height < $max_h and $width < $max_w; } push @array, $string =~ m#stuff#g if is_image_size_ok($image);

Replies are listed 'Best First'.
Re^6: adding an IF to a push
by sulfericacid (Deacon) on Jun 28, 2006 at 05:30 UTC
    Thank you ikegami for clearing that up. I knew it was possible but I couldn't get the syntax to work although now that I look back, I have to wonder what I was thinking in the first place. Easy stuff.


    "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

    sulfericacid

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found