tokuhirom / Perl-MinimumVersion-Fast

Other
4 stars 5 forks source link

Starting with Perl 5.14, "unshift" can take a scalar EXPR, which must hold a reference to an unblessed array. #8

Closed apocalypse closed 9 years ago

apocalypse commented 9 years ago

This check tripped me up in Dist::Zilla::Plugin::Authority v1.008 when using Perl::MinimumVersion and I wanted to check this module just in case you reproduced the bug too.

Unfortunately, this module only fared better as it determined the following code's minimum is 5.008 when it actually should be 5.14! Perl::MinimumVersion did worse, returning 5.006 so please don't feel bad ;)

https://github.com/apocalypse/perl-dist-zilla-plugin-authority/blob/master/lib/Dist/Zilla/Plugin/Authority.pm#L239 which was

unshift $block->{children}, PPI::Token::Whitespace->new("\n"), $self->_make_authority( $package ), PPI::Token::Whitespace->new("\n");

I'm not sure if it is "easy" to check if $block->{children} is an arrayref or not? Maybe that's the reason why it failed to detect this? Thanks for looking into this!

tokuhirom commented 9 years ago

Hmm. I guess it's bit hard to detect. I'm waiting @neilbowers' answer :p

charsbar commented 9 years ago

Shipped 0.15 with a fix for this. Thanks for your report.