6 my $method = shift() ? 'import' : 'unimport';
7 return unless shift; # CONDITION
9 my $p = $_[0]; # PACKAGE
10 (my $file = "$p.pm") =~ s!::!/!g;
13 my $m = $p->can($method);
17 sub import { shift; unshift @_, 1; goto &work }
18 sub unimport { shift; unshift @_, 0; goto &work }
25 if - C<use> a Perl module if a condition holds
29 use if CONDITION, MODULE => ARGUMENTS;
35 use if CONDITION, MODULE => ARGUMENTS;
37 has no effect unless C<CONDITION> is true. In this case the effect is
44 The current implementation does not allow specification of the
45 required version of the module.
49 Ilya Zakharevich L<mailto:perl-module-if@ilyaz.org>.