Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
We don't bite newbies here... much
 
PerlMonks  

Re: disable functions if module not installed

by Anonymous Monk
on Nov 04, 2008 at 20:04 UTC ( #721493=note: print w/ replies, xml ) Need Help??


in reply to disable functions if module not installed

Your first snippet of:

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; }
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.

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?


Comment on Re: disable functions if module not installed
Download Code
Re^2: disable functions if module not installed
by lepetitalbert (Monsignor) on Nov 04, 2008 at 23:16 UTC

    Hi,

    wrote a post on the imagemagick.

    Thank you all and don't forget to have a nice day.

    "There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates

      Hello dear Monks,

      answer from magick

      We may need help on this one because we're not well versed in Perl XS programming. Anyone have a solution for this problem?

      Any solution or hint on how to trace / check / fix this ?

      Have a nice day.

      "There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://721493]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2014-04-21 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (493 votes), past polls