lib::coreplus - Allow core modules plus a few others
This document describes version 0.26 of lib::coreplus (from Perl distribution lib-filter), released on 2016-08-23.
% perl -Mlib::coreplus=Clone,Data::Structure::Util yourscript.pl
This pragma uses lib::filter's custom filter to accomplish its function.
filter
Rationale for this pragma: using lib::filter's allow_noncore=0+allow doesn't work for non-core XS modules because allow_noncore=0 will remove non-core directories from @INC, while XS modules will still look for their loadable objects in @INC during loading.
lib::filter
allow_noncore=0
allow
@INC
So the alternative approach used by lib::coreplus is to check the module against Module::CoreList->is_core. If the module is not a core module according to is_core, it is then checked against the list of additional modules specified by the user. If both checks fail, the module is disallowed. lib::coreplus does not remove directories from @INC because it does not use allow_noncore=0.
lib::coreplus
Module::CoreList->is_core
is_core
Please visit the project's homepage at https://metacpan.org/release/lib-filter.
Source repository is at https://github.com/perlancar/perl-lib-filter.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=lib-filter
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) 2016 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 lib::filter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm lib::filter
CPAN shell
perl -MCPAN -e shell install lib::filter
For more information on module installation, please visit the detailed CPAN module installation guide.