From 4e66b9cd047e4e264394200b2dd0288178bece73 Mon Sep 17 00:00:00 2001 From: Toby Inkster Date: Fri, 19 Jul 2013 18:11:26 +0100 Subject: Works in Perl 5.6. _strip_opt seems to trigger some bizarro bug in Perl 5.6 taking an index within @_. --- lib/Dist/CheckConflicts.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Dist/CheckConflicts.pm b/lib/Dist/CheckConflicts.pm index 97c22d9..299a746 100644 --- a/lib/Dist/CheckConflicts.pm +++ b/lib/Dist/CheckConflicts.pm @@ -1,7 +1,7 @@ package Dist::CheckConflicts; use strict; use warnings; -use 5.008001; +use 5.006; # ABSTRACT: declare version conflicts for your dist use base 'Exporter'; @@ -173,16 +173,16 @@ sub import { } sub _strip_opt { - my $opt = shift; - my $idx = first_index { ( $_ || '' ) eq $opt } @_; + my ($opt, @args) = @_; + my $idx = first_index { ( $_ || '' ) eq $opt } @args; - return ( undef, @_ ) unless $idx >= 0 && $#_ >= $idx + 1; + return ( undef, @args ) unless $idx >= 0 && $#args >= $idx + 1; - my $val = $_[ $idx + 1 ]; + my $val = $args[ $idx + 1 ]; - splice @_, $idx, 2; + splice @args, $idx, 2; - return ( $val, @_ ); + return ( $val, @args ); } sub _check_version { -- cgit v1.2.3