in reply to disable functions if module not installed
Your first snippet of:
works exactly as you want, when run as written above. $is_magick is set to 0 if GD is not available and 1 if GD is available.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; }
That suggests that there's something about your implementation of this snippet in your module or program that prevents it from working.
Can you provide a sample of code that you have written which demonstrates erroneous behaviour?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: disable functions if module not installed
by lepetitalbert (Abbot) on Nov 04, 2008 at 23:16 UTC | |
by lepetitalbert (Abbot) on Nov 06, 2008 at 08:32 UTC |
In Section
Seekers of Perl Wisdom