Skip Menu |

This queue is for tickets about the Perl-MinimumVersion CPAN distribution.

Report information
The Basics
Id: 35902
Status: open
Priority: 0/
Queue: Perl-MinimumVersion

People
Owner: Nobody in particular
Requestors: SAPER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.15
Fixed in: (no value)



Subject: [PATCH] dual-life and compat modules have changed the situation
Hello Adam, Recent developments allow us to be more compatible with the same code: constant.pm is now dual-life and the multiple declaration works on 5.005; warnings.pm isn't but I wrote warnings::compat to handle this (and it should work on Perl 5.000). Attached is a patch that change Perl::MinimumVersion so it can handle the new situation, with additional pragmas that were missing, including the ones introduced by 5.8 and 5.10 Regards -- Close the world, txEn eht nepO.
Subject: Perl-MinimumVersion-0.15-pragmas.diff
diff -ru Perl-MinimumVersion-0.15-old/lib/Perl/MinimumVersion.pm Perl-MinimumVersion-0.15-new/lib/Perl/MinimumVersion.pm --- Perl-MinimumVersion-0.15-old/lib/Perl/MinimumVersion.pm 2007-07-17 06:05:40.000000000 +0200 +++ Perl-MinimumVersion-0.15-new/lib/Perl/MinimumVersion.pm 2008-05-15 15:10:33.693875878 +0200 @@ -56,7 +56,7 @@ # Various small things _bugfix_magic_errno => version->new('5.008.003'), _unquoted_versions => version->new('5.008.001'), - _constant_hash => version->new('5.008'), + _constant_hash => version->new('5.005'), _use_base_exporter => version->new('5.008'), # Included in 5.6. Broken until 5.8 @@ -77,15 +77,30 @@ # Predefine some indexes needed by various check methods %MATCHES = ( + _perl_5010_pragmas => { + feature => 1, + mro => 1, + version => 1, + }, + _perl_5008_pragmas => { + bigint => 1, + bignum => 1, + bigrat => 1, + sort => 1, + threads => 1, + encoding => 1, + }, _perl_5006_pragmas => { - warnings => 1, attributes => 1, + bytes => 1, + charnames => 1, open => 1, filetest => 1, }, _perl_5005_pragmas => { re => 1, fields => 1, + base => 1, attr => 1, }, );
Had forgot to adapt the test as well. Here's the corresponding patch. -- Close the world, txEn eht nepO.
diff -ru Perl-MinimumVersion-0.15-old/t/02_main.t Perl-MinimumVersion-0.15-new/t/02_main.t --- Perl-MinimumVersion-0.15-old/t/02_main.t 2007-07-17 06:05:40.000000000 +0200 +++ Perl-MinimumVersion-0.15-new/t/02_main.t 2008-05-15 15:26:27.483405557 +0200 @@ -160,7 +160,7 @@ # Check the use of constant hashes SCOPE: { -my $v = version_is( <<'END_PERL', '5.008', 'constant hash adds a 5.008 dep' ); +my $v = version_is( <<'END_PERL', '5.005', 'constant hash adds a 5.005 dep' ); use constant { FOO => 1, };
On Thu May 15 06:23:04 2008, SAPER wrote: Show quoted text
> Recent developments allow us to be more compatible with the same > code: constant.pm is now dual-life and the multiple declaration > works on 5.005; warnings.pm isn't but I wrote warnings::compat > to handle this (and it should work on Perl 5.000).
It's also possible to tap into the database provided in Module::CoreList to make these determinations.