From 667b38f6a42647f49464b19cd6792a51aa238fd4 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 8 Jan 2017 13:30:34 +0100 Subject: Dpkg: Call anonymous subs via -> operator instead of casting with & And fix the documentation while at it, which was incorrect code. --- scripts/Dpkg/Conf.pm | 4 ++-- scripts/Dpkg/Substvars.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/Dpkg') diff --git a/scripts/Dpkg/Conf.pm b/scripts/Dpkg/Conf.pm index 2e27f3410..ca98cd3a7 100644 --- a/scripts/Dpkg/Conf.pm +++ b/scripts/Dpkg/Conf.pm @@ -206,7 +206,7 @@ sub parse { =item $conf->filter(%opts) Filter the list of options, either removing or keeping all those that -return true when &$opts{remove}($option) or &opts{keep}($option) is called. +return true when $opts{remove}->($option) or $opts{keep}->($option) is called. =cut @@ -217,7 +217,7 @@ sub filter { croak 'obsolete option format_argv' if exists $opts{format_argv}; - @{$self->{options}} = grep { not &$remove($_) and &$keep($_) } + @{$self->{options}} = grep { not $remove->($_) and $keep->($_) } @{$self->{options}}; } diff --git a/scripts/Dpkg/Substvars.pm b/scripts/Dpkg/Substvars.pm index 8f06d1f39..9d52f32b5 100644 --- a/scripts/Dpkg/Substvars.pm +++ b/scripts/Dpkg/Substvars.pm @@ -370,7 +370,7 @@ sub set_msg_prefix { =item $s->filter(keep => $keepfun) Filter the substitution variables, either removing or keeping all those -that return true when &$rmfunc($key) or &keepfunc($key) is called. +that return true when $rmfunc->($key) or $keepfunc->($key) is called. =cut @@ -381,7 +381,7 @@ sub filter { my $keep = $opts{keep} // sub { 1 }; foreach my $vn (keys %{$self->{vars}}) { - $self->delete($vn) if &$remove($vn) or not &$keep($vn); + $self->delete($vn) if $remove->($vn) or not $keep->($vn); } } -- cgit v1.2.3