The newest Best (0.08+) allows you to specify a minimum version, arbitrary pre- and post-loading criteria, per-module import lists, and substitute your own arbitrary code for perl modules.
Each one of these features addresses something I've solved in adhoc ways in the past but wished there were a standard way. Now there is. Yay!
PS, Gaal rocks.
use Best( 'Foo::Better' => 1.02, 'Foo::Worse' ); use Best( 'Foo::Better' => { version => 1.02 }, 'Foo::Worse' );
# pre-loading check use Best( 'Foo::Better' => { if => sub { $] >= 5.008 } }, 'Foo::Worse' ); # post-loading check use Best( 'Foo::Better' => { ok => sub { defined &some_import } }, 'Foo::Worse' );
use Best( 'Foo::Better' => { args => [ ... ] }, 'Foo::Worse' );
use Best( sub { return eval { require Foo::Better; if ( Foo::Better->can( ... ) ) { return 1; # PASS } else { return; # FAIL } }; }, 'Foo::Worse' );