Subject: | 5.010 operators |
Date: | Sun, 28 Jun 2009 09:24:39 +1000 |
To: | bug-Perl-MinimumVersion [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With Perl::MinimumVersion 1.20 and recent debian perl 5.010 a program
use Perl::MinimumVersion;
print Perl::MinimumVersion->new(\'1 // 2')->minimum_version;
prints 5.004, where I hoped it would be 5.010 due to the use of the //
operator. Perhaps the change below (Magic and Operator the opposite way
around for their tests ...).
--- MinimumVersion.pm.orig 2009-06-18 09:04:14.000000000 +1000
+++ MinimumVersion.pm 2009-06-18 09:05:12.000000000 +1000
@@ -440,7 +440,7 @@
sub _perl_5010_operators {
shift->Document->find_any( sub {
- $_[1]->isa('PPI::Token::Magic')
+ $_[1]->isa('PPI::Token::Operator')
and
$MATCHES{_perl_5010_operators}->{$_[1]->content}
} );
@@ -448,7 +448,7 @@
sub _perl_5010_magic {
shift->Document->find_any( sub {
- $_[1]->isa('PPI::Token::Operator')
+ $_[1]->isa('PPI::Token::Magic')
and
$MATCHES{_perl_5010_magic}->{$_[1]->content}
} );