$is_magick = 0; if ( is_installed Image::Magick ) { $is_magick = 1 } #### if ( $is_magick = 0 ) { print "Image::Magick functions disabled"; } else { do stuff with Image::Magick ... } #### our $is_magick = 0; eval 'require GD'; if ($@) { # problems with GD, fall back to non-GD } else { # we have GD, go for it! $is_magick = 1; } #### our $is_magick = 1; BEGIN { unless (eval "use Image::Magick") { $is_magick = 0; } }