Skip to content

Commit

Permalink
PATCH: [perl #131142] Revise 'if' documentation
Browse files Browse the repository at this point in the history
This adds text about how to import when you want to 'use MODULE ()'
  • Loading branch information
KenCotterill authored and khwilliamson committed Jun 1, 2017
1 parent 89a7486 commit 1627961
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dist/if/if.pm
@@ -1,6 +1,6 @@
package if;

$VERSION = '0.0606';
$VERSION = '0.0607';

sub work {
my $method = shift() ? 'import' : 'unimport';
Expand Down Expand Up @@ -50,6 +50,15 @@ The use of C<< => >> above provides necessary quoting of C<MODULE>.
If you don't use the fat comma (eg you don't have any ARGUMENTS),
then you'll need to quote the MODULE.
If you wanted ARGUMENTS to be an empty list, i.e. have the effect of:
use MODULE ();
you can't do this with the C<if> pragma; however, you can achieve
exactly this effect, at compile time, with:
BEGIN { require MODULE if CONDITION }
=head2 EXAMPLES
The following line is taken from the testsuite for L<File::Map>:
Expand Down

0 comments on commit 1627961

Please sign in to comment.