Yes, the title is a bit of an oxymoron, but I got your attention, didn't I?
Anyway, I'm in discussion with a bug reporter about using the Graphics::TIFF library to support TIFF image handling. Now, not that many users of a PDF::Builder-based program are going to be handling TIFFs (especially Group 3 and Group 4 Fax), so I hesitate to include a seldom-used library in the build prerequisites. In the CPAN world, what is the protocol and custom in requiring seldom-used libraries in a build? It appears that I will sometimes get an error during the compilation stage of running a program, if I put "use Graphics::TIFF;" in a .pm file, and don't have it installed. Other times (depending on where the "use" is), I don't, so that would suggest that I don't have to list all used modules in the build process. Is this practice considered clean or sloppy? If Graphics::TIFF isn't installed, I want to handle any "not found" error with a message "You need to install the Graphics::TIFF package if you want to use TIFF functionality.", but only show that message from within the TIFF module(s) that need it.
Font::TTF is a current requirement that applies only to TrueType font handling, so it too might be a candidate for being made optional. In the future there might be a number of BarCode-related libraries that should not be made mandatory. Or am I just overthinking this, and no one cares if a package like PDF::Builder installs modules that they'll never use? What is considered best practice?
Add: P.S. Obviously, if a library such as Graphics::TIFF is optional, it can not be in the standard "t" tests for installation. For the benefit of developers, "t" tests using this library could be put somewhere else (perhaps as t/optional/tiff.t?), so long as the standard install tests don't try to run them.