Subject: | Modules::ProhibitPOSIXimport broken with Perl < 5.10 |
Version 91 introduced a change in Modules::ProhibitPOSIXimport that used the defined-or operator, which was introduced in Perl 5.10.0. As a result, the module (and test suite) fail quite spectacularly on Perl 5.8.x or earlier.
The following change works for me:
--- lib/Perl/Critic/Policy/Modules/ProhibitPOSIXimport.pm
+++ lib/Perl/Critic/Policy/Modules/ProhibitPOSIXimport.pm
@@ -121,7 +121,8 @@ sub _parse_args {
my @ret;
while (@first) {
- my $aref = shift @first // next;
+ my $aref = shift @first;
+ next unless defined($aref);
if (@$aref == 1) {
my $elem = $aref->[0];
if ($elem->isa('PPI::Structure::List')) {