in reply to Re^2: adding an IF to a push
in thread adding an IF to a push
push @array, $string =~ m#stuff#g if sub { my $img = get($image); my ($height, $width) = imgsize(\$img); $height < $max_h and $width < $max_w; }->();
Zaxo's do is more direct and has less overhead, but why not just use the following:
my $img = get($image); my ($height, $width) = imgsize(\$img); push @array, $string =~ m#stuff#g if $height < $max_h and $width < $max_w;
You can wrap the whole thing in curlies if you want to limit the scope of $img, $height and $width.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: adding an IF to a push
by sulfericacid (Deacon) on Jun 28, 2006 at 04:45 UTC | |
by ikegami (Patriarch) on Jun 28, 2006 at 05:15 UTC | |
by sulfericacid (Deacon) on Jun 28, 2006 at 05:30 UTC | |
Re^4: adding an IF to a push
by Anonymous Monk on Jun 28, 2006 at 05:40 UTC | |
by ikegami (Patriarch) on Jun 28, 2006 at 06:01 UTC | |
by shmem (Chancellor) on Jun 28, 2006 at 06:01 UTC | |
by ikegami (Patriarch) on Jun 28, 2006 at 06:13 UTC | |
by shmem (Chancellor) on Jun 28, 2006 at 06:23 UTC |