in reply to Re^2: Warning in objImageMagick
in thread Warning in objImageMagick
Hi Anonymous,
It looks like you missed the warn statement in front of "$obj_temp" if "$obj_temp", and your precedence on the .0+$obj_temp in the last warn isn't quite right. Also, you'll probably want to further inspect $obj_temp only if it actually was an error, something like:
my $obj_temp = $objImageMagick->Read("foo.jpg","bar.jpg"); if ("$obj_temp") { $obj_temp =~ /(\d+)/; warn "Error Number $1, number of images read: ".(0+$obj_temp); # handle the error further, like maybe "die" }
When I run this with the file foo.jpg existing and the file bar.jpg not existing, I get the output:
Error Number 435, number of images read: 1 at ....
Hope this helps,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Warning in objImageMagick
by Anonymous Monk on Apr 02, 2016 at 17:45 UTC | |
by haukex (Archbishop) on Apr 02, 2016 at 17:59 UTC | |
by Anonymous Monk on Apr 02, 2016 at 18:23 UTC | |
by haukex (Archbishop) on Apr 02, 2016 at 18:39 UTC | |
by Anonymous Monk on Apr 02, 2016 at 19:03 UTC |