Subject: | double-colon bareword Foo::Bar:: in 5.005 |
Date: | Thu, 15 Apr 2010 10:30:40 +1000 |
To: | bug-Perl-MinimumVersion [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
Perl::MinimumVersion might report on the new double-colon bareword
syntax. I've been using the following few lines.
# Foo::Bar:: bareword new in 5.005
# generally a compile-time syntax error in 5.004
#
sub bareword_double_colon {
my ($pmv) = @_;
$pmv->Document->find_first
(sub {
my ($document, $elem) = @_;
if ($elem->isa('PPI::Token::Word')
&& $elem =~ /::$/) {
return 1;
} else {
return 0;
}
});
}