There's more than one way to do things | |
PerlMonks |
Re^5: Using a base module with a required versionby davido (Cardinal) |
on Aug 04, 2019 at 02:49 UTC ( [id://11103837]=note: print w/replies, xml ) | Need Help?? |
Here it is: parent::versioned version 0.002. This link points directly to the initial mainline (non-dev) CPAN release version. It passes the full parent test suite, plus additional tests around the versioning logic. Code test coverage is 100%. Once the CPAN mirrors pick it up this link will be best for long-term use, as it's not tied to a version number: parent::versioned. Synopsis:
Version checking happens at compiletime, since it's built into the import() method. Any version failure will throw an exception. Any module that requires version checking should be specified in an array-ref tuple. Multiple tuples may exist, and may be combined with non-version-checked inheritance too. It's not in the Perl core, so you'll have to install it using your favorite method. It adds no dependencies besides Perl itself. Dave
In Section
Seekers of Perl Wisdom
|
|