Perl::PrereqScanner::NotQuiteLite::Context
This is typically used to keep callbacks, an eval state, and found prerequisites for a processing file.
$c->add($module); $c->add($module => $minimum_version);
adds a module with/without a minimum version as a requirement or a suggestion, depending on the eval state. You can add a module with different versions as many times as you wish. The actual minimum version for the module is calculated inside (by CPAN::Meta::Requirements).
$c->register_keyword_parser( 'func_name', [$parser_class, 'parser_for_the_func', $used_module], ); $c->remove_keyword_parser('func_name'); $c->register_method_parser( 'method_name', [$parser_class, 'parser_for_the_method', $used_module], );
If you find a module that can export a loader function is actually used (such as Moose that can export an extends function that will load a module internally), you might also register the loader function as a custom keyword dynamically so that the scanner can also run a callback for the function to parse its argument tokens.
use
extends
You can also remove the keyword when you find the module is noed (and when the module supports unimport).
no
unimport
You can also register a method callback on the fly (but you can't remove it).
If you always want to check some functions/methods when you load a plugin, just register them using a register method in the plugin.
register
returns a CPAN::Meta::Requirements object for requirements.
returns a CPAN::Meta::Requirements object for suggestions (requirements in evals), or undef when it is not expected to parse tokens in eval.
eval
creates an instance. You usually don't need to call this because it's automatically created in the scanner.
next unless $c->has_callbacks('use'); next unless $c->has_callbacks_for('use', 'base'); $c->run_callbacks_for('use', 'base', $tokens);
has_callbacks returns true if a callback for use, no, keyword, or method is registered. has_callbacks_for returns true if a callback for the module/keyword/method is registered. run_callbacks_for is to run the callback.
has_callbacks
keyword
method
has_callbacks_for
run_callbacks_for
returns true if a module has already been added as a requirement or a suggestion. Only useful for the ::UniversalVersion plugin.
Kenichi Ishigaki, <ishigaki@cpan.org>
This software is copyright (c) 2015 by Kenichi Ishigaki.
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 Perl::PrereqScanner::NotQuiteLite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::PrereqScanner::NotQuiteLite
CPAN shell
perl -MCPAN -e shell install Perl::PrereqScanner::NotQuiteLite
For more information on module installation, please visit the detailed CPAN module installation guide.