1Perl::PrereqScanner::NoUtsQeuritCeoLnittrei:bP:ueCtroelnd:t:ePPxertre(lr3e)DqoSccuamnennetra:t:iNoontQuiteLite::Context(3)
2
3
4
6 Perl::PrereqScanner::NotQuiteLite::Context
7
9 This is typically used to keep callbacks, an eval state, and found
10 prerequisites for a processing file.
11
13 add
14 $c->add($module);
15 $c->add($module => $minimum_version);
16
17 adds a module with/without a minimum version as a requirement or a
18 suggestion, depending on the eval state. You can add a module with
19 different versions as many times as you wish. The actual minimum
20 version for the module is calculated inside (by
21 CPAN::Meta::Requirements).
22
23 register_keyword_parser, remove_keyword_parser, register_method_parser,
24 register_sub_parser
25 $c->register_keyword_parser(
26 'func_name',
27 [$parser_class, 'parser_for_the_func', $used_module],
28 );
29 $c->remove_keyword_parser('func_name');
30
31 $c->register_method_parser(
32 'method_name',
33 [$parser_class, 'parser_for_the_method', $used_module],
34 );
35
36 If you find a module that can export a loader function is actually
37 "use"d (such as Moose that can export an "extends" function that will
38 load a module internally), you might also register the loader function
39 as a custom keyword dynamically so that the scanner can also run a
40 callback for the function to parse its argument tokens.
41
42 You can also remove the keyword when you find the module is "no"ed (and
43 when the module supports "unimport").
44
45 You can also register a method callback on the fly (but you can't
46 remove it).
47
48 If you always want to check some functions/methods when you load a
49 plugin, just register them using a "register" method in the plugin.
50
51 requires
52 returns a CPAN::Meta::Requirements object for requirements.
53
54 suggests
55 returns a CPAN::Meta::Requirements object for suggestions (requirements
56 in "eval"s), or undef when it is not expected to parse tokens in
57 "eval".
58
60 new
61 creates an instance. You usually don't need to call this because it's
62 automatically created in the scanner.
63
64 has_callbacks, has_callback_for, run_callback_for
65 next unless $c->has_callbacks('use');
66 next unless $c->has_callbacks_for('use', 'base');
67 $c->run_callbacks_for('use', 'base', $tokens);
68
69 "has_callbacks" returns true if a callback for "use", "no", "keyword",
70 or "method" is registered. "has_callbacks_for" returns true if a
71 callback for the module/keyword/method is registered.
72 "run_callbacks_for" is to run the callback.
73
74 has_added
75 returns true if a module has already been added as a requirement or a
76 suggestion. Only useful for the ::UniversalVersion plugin.
77
79 Kenichi Ishigaki, <ishigaki@cpan.org>
80
82 This software is copyright (c) 2015 by Kenichi Ishigaki.
83
84 This is free software; you can redistribute it and/or modify it under
85 the same terms as the Perl 5 programming language system itself.
86
87
88
89perl v5.30.1 P2e0r2l0:-:0P1r-e3r0eqScanner::NotQuiteLite::Context(3)