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

disable functions if module not installed

by lepetitalbert (Monsignor)
on Nov 03, 2008 at 21:21 UTC ( #721195=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $is_magick = 0;
    
    if ( is_installed Image::Magick ) { $is_magick = 1 }
    
  2. or download this
    if ( $is_magick = 0 ) {
    
    ...
    
      do stuff with Image::Magick ...
    }
    
  3. or download this
    our $is_magick = 0;
    eval 'require GD';
    ...
      # we have GD, go for it!
      $is_magick = 1;
    }
    
  4. or download this
    our $is_magick = 1;
    BEGIN {
    ...
        $is_magick = 0;
      }
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-04-20 14:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls