Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Exception handling for Image::Magick

by redlemon (Hermit)
on Sep 05, 2004 at 14:55 UTC ( [id://388614]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
       $err = $image->DoSomething;
       if("$err") {  # one must evaluate the return value
    ...
                     # PerlMagick docs
          die ("Can't do Something: $err\n");
       }
    
  2. or download this
        eval {
           $image->DoSomething;
    ...
           $image->Save;
        };
        if($@) { handle_the_error; }
    
  3. or download this
    package Image::Magick::Exceptions;
    use warnings;
    ...
    use Image::Magick::Exceptions;
    
    etc();
    
  4. or download this
       $ret = $image->Write;
       if ("$ret") { error("$ret") }
       print $ret . " images written";
    
  5. or download this
       $clone = $image->Clone;
       if (!ref $clone) { error($clone) }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://388614]
Approved by Corion
Front-paged by BrowserUk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found