Check::UnitCheck

Use best of CHECK or UNITCHECK
Download

Check::UnitCheck Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Alex Gough
  • Publisher web site:
  • http://search.cpan.org/~ajgough/

Check::UnitCheck Tags


Check::UnitCheck Description

Use best of CHECK or UNITCHECK Perl 5.10.0 will include the UNITCHECK block. This block runs the moment the compilation unit in which it was defined has finished compiling. Perl versions before that had only the CHECK block, which runs once global compilation has completed, which might or might not be at the same time that the compilation unit which defines it has finished.Check::UnitCheck is a Perl module that allows you to define a block which will run as a UNITCHECK block in Perls that allow that, or as a CHECK block in Perls that do not. This should allow you to use UNITCHECK semantics in a CPAN module, while having a moderately graceful fallback for versions of perl that cannot support that.Instead of writing: CHECK { ... code ... }or UNITCHECK { ... code ... }You instead say: use Check::UnitCheck sub { ... code ... };At the moment you can only do one sub at once (you can use the module more than once, though). In the future extra options might be provided to allow you to inject these blocks into other modules.If you want to push a UNITCHECK block into the queue of a compilation unit that has imported you, then you can do so by calling: Check::UnitCheck::unitcheckify(sub {...});directly.As code passed into the UNITCHECK or CHECK queue is marked as CvSPECIAL it is probably unwise to use references to named subroutines.SYNOPSIS use Check::UnitCheck sub { ... }; # runs sub at best of UNITCHECK or global CHECK, depending Requirements: · Perl


Check::UnitCheck Related Software