NAME
maybe - Use a Perl module and ignore error if can't be loaded
SYNOPSIS
use Getopt::Long;
use maybe 'Getopt::Long::Descriptive';
if (maybe::HAVE_GETOPT_LONG_DESCRIPTIVE) {
Getopt::Long::Descriptive::describe_options("usage: %c %o", @options);
}
else {
Getopt::Long::GetOptions(\%options, @$opt_spec);
}
use maybe 'Carp' => 'confess';
if (maybe::HAVE_CARP) {
confess("Bum!");
}
else {
die("Bum!");
}
DESCRIPTION
This pragma loads a Perl module. If the module can't be loaded, the
error will be ignored. Otherwise, the module's import method is called
with unchanged caller stack.
The special constant `maybe::HAVE_*MODULE*' is created and it can be
used to enable or disable block of code at compile time.
AUTHOR
Piotr Roszatycki <dexter@cpan.org>
COPYRIGHT
Copyright (C) 2008, 2009 by Piotr Roszatycki <dexter@cpan.org>.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.