In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/d1d50e3e86916d266355a8fe5c5374460f7aa033?hp=21639bf469a072bd10798e16db95edc313588cbb>
- Log ----------------------------------------------------------------- commit d1d50e3e86916d266355a8fe5c5374460f7aa033 Author: Karl Williamson <[email protected]> Date: Thu Mar 26 21:33:04 2015 -0600 if.pm: Note that works with 'no' besides 'use' ----------------------------------------------------------------------- Summary of changes: dist/if/if.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dist/if/if.pm b/dist/if/if.pm index 511b8a5..b118302 100644 --- a/dist/if/if.pm +++ b/dist/if/if.pm @@ -1,6 +1,6 @@ package if; -$VERSION = '0.0603'; +$VERSION = '0.0604'; sub work { my $method = shift() ? 'import' : 'unimport'; @@ -23,15 +23,16 @@ __END__ =head1 NAME -if - C<use> a Perl module if a condition holds +if - C<use> a Perl module if a condition holds (also can C<no> a module) =head1 SYNOPSIS use if CONDITION, MODULE => ARGUMENTS; + no if CONDITION, MODULE => ARGUMENTS; =head1 DESCRIPTION -The C<if> module is used to conditionally load another module. +The C<if> module is used to conditionally load or unload another module. The construct use if CONDITION, MODULE => ARGUMENTS; @@ -71,6 +72,14 @@ calling module was C<use>'d from a core library directory, and if so, generates a warning), unless you've installed a more recent version of L<Text::Soundex> from CPAN. +You can also specify to NOT use something: + + no if $] ge 5.021_006, warnings => "locale"; + +This warning category was added in the specified Perl version (a development +release). Without the C<'if'>, trying to use it in an earlier release would +generate an unknown warning category error. + =head1 BUGS The current implementation does not allow specification of the -- Perl5 Master Repository
