if::notprog - use a Perl module if program matches
use
This document describes version 0.01 of if::notprog (from Perl distribution if-Pragmas), released on 2014-10-09.
In Perl script:
use if::notprog 'foo|bar', MODULE => ARGUMENTS;
On command-line:
perl -Mif::notprog='foo,Devel::EndStats::LoadedMods' foo ...
In crontab:
PERL5OPT='-Mif::notprog=foo,Devel::EndStats::LoadedMods' # this Perl program will load Devel::EndStats::LoadedMods 1 1 * * * bar other args # this Perl program won't 0 0 * * * foo some arg
use if::notprog $prog, MODULE => ARGUMENTS;
is a shortcut for:
use if $0 !~ $prog, MODULE => ARGUMENTS;
The reason this pragma is created is to make it easier to specify on command-line (especially using the -M perl switch or in PERL5OPT).
-M
PERL5OPT
Please visit the project's homepage at https://metacpan.org/release/if-Pragmas.
Source repository is at https://github.com/perlancar/perl-if-Pragmas.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=if-Pragmas
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2014 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install if::Pragmas, copy and paste the appropriate command in to your terminal.
cpanm
cpanm if::Pragmas
CPAN shell
perl -MCPAN -e shell install if::Pragmas
For more information on module installation, please visit the detailed CPAN module installation guide.