GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Perl::PrereqScanner::NotQuiteLite::Context(3) User Contributed Perl Documentation Perl::PrereqScanner::NotQuiteLite::Context(3)

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 "use"d (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.

You can also remove the keyword when you find the module is "no"ed (and when the module supports "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.

returns a CPAN::Meta::Requirements object for requirements.

returns a CPAN::Meta::Requirements object for suggestions (requirements in "eval"s), or undef when it is not expected to parse tokens in "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.

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.

2021-01-17 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.