in reply to adding an IF to a push

If I understand what you want to achieve then something like this would seem to be what you are after:

if ($this eq "true") { my $img = get($image); my ($height, $width) = imgsize(\$img); push @array, $string =~ m#stuff#g if $height < $max_h && $width < +$max_w; }

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: adding an IF to a push
by sulfericacid (Deacon) on Jun 28, 2006 at 04:10 UTC
    This post like the one from the other day asking for a regex to push images onto. If that's the case, that regex would have to match prior to testing it's size.

    Though I could be wrong entirely. I'll link the node if ever I find it

    UPDATE: looked and looked and cannot find it. Maybe it was Tek-Tips or another site I'm thinking of.



    "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