I have a Perl script which uses a not-so-common module, and I want it to be usable without that module being installed, although with limited functionality. Is it possible?
You can use require to load modules at runtime, and eval to trap possible exceptions:
eval { require Foobar; Foobar->import(); }; if ($@) { warn "Error including Foobar: $@"; }
See also perldoc use.