in reply to Checking to see if a particular Module is installed

My approach has always been:
BEGIN { eval "use GD"; $can_GD = 1 unless $@; };
Or something along those lines. Almost indistinguishable from the previous posts, admittedly, but I always try to be careful to wrap it up in BEGIN blocks. That way you're sure that the import is actually done at compile time instead of run time and it's virtually indistinguishable from an actual use.

So you don't need to worry about functions not be prototyped or whatnot.

Replies are listed 'Best First'.
RE: Re: Checking to see if a particular Module is installed
by tye (Sage) on Aug 11, 2000 at 22:06 UTC

    Actually, you probably still need to worry about that (be sure to test your code without the GD module installed). Most of the things I find useful about doing the import at compile time can't be easily used if you want to support the possible lack of the module. See my other nodes in this thread for more info.

            - tye (but my friends call me "Tye")