Bug 12164: (followup) keys expects a hash parameter
authorTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 24 Jul 2014 18:40:32 +0000 (15:40 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 24 Jul 2014 18:43:44 +0000 (15:43 -0300)
As of http://perldoc.perl.org/functions/keys.html we should avoid passing
a scalar parameter as it is not backwards compatible with squeezze's Perl
version (5.10).

Cite:
"Starting with Perl 5.14, keys can take a scalar EXPR, which must contain a
reference to an unblessed hash or array. The argument will be dereferenced
automatically. This aspect of keys is considered highly experimental. The
exact behaviour may change in a future version of Perl."

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Budgets.pm

index ae6a441..e0e8f72 100644 (file)
@@ -1109,7 +1109,7 @@ sub CloneBudgetHierarchy {
 
         my $tidy_budget =
           { map { join( ' ', @columns ) =~ /$_/ ? ( $_ => $budget->{$_} ) : () }
-              keys($budget) };
+              keys %$budget };
         my $new_budget_id = AddBudget(
             {
                 %$tidy_budget,