version_regex - Lift and mung version::regex regexen
version_regex version_regex -help version_regex -version
If this Boolean option is asserted, the output is a Data::Dumper dump of the regexp.
This option displays the documentation for this script. The script then exits.
If this Boolean option is asserted, the output is constant STRICT__VERSION rather than LAX_VERSION, and is based on $version::regex::STRICT.
STRICT__VERSION
LAX_VERSION
$version::regex::STRICT
The default is -nostrict
-nostrict
This option displays the version of this script. The script then exits.
This unsupported Perl script loads version::regex, serializes $version::regex::LAX, modifies it to suit, and generates code to include it into Test2::Tools::LoadModule.
version::regex
$version::regex::LAX
Caveat: version::regex is undocumented, and does not come with older versions of version. So this script represents major mucking around with the internals of another module. Be warned.
The only modification needed to the underlying regex is to remove the leading undef | . But under any modern Perl, serialization introduces the notation '(?^:...), which requires at least Perl 5.13.6. Because /x is the only modifier used, I was able to
undef |
'(?^:...)
/x
s/ \? \^ : /?-x:/smxg; s/ \? \^ x: /?x:/smxg; s/ \? : /?-x:/smxg;
to get the intended effect.
Thomas R. Wyant, III wyant at cpan dot org
Copyright (C) 2020 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install Test2::Tools::LoadModule, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test2::Tools::LoadModule
CPAN shell
perl -MCPAN -e shell install Test2::Tools::LoadModule
For more information on module installation, please visit the detailed CPAN module installation guide.