summaryrefslogtreecommitdiff
path: root/scripts/Dpkg
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2017-01-08 13:30:34 +0100
committerGuillem Jover <guillem@debian.org>2017-01-23 00:11:26 +0100
commit667b38f6a42647f49464b19cd6792a51aa238fd4 (patch)
treecdac73bdc9ea7f02f4427a81bbcc1edfe2256327 /scripts/Dpkg
parent83b5b8fe54f21dec140282ee4a2ea01b90b6b6a5 (diff)
downloaddpkg-667b38f6a42647f49464b19cd6792a51aa238fd4.tar.gz
Dpkg: Call anonymous subs via -> operator instead of casting with &
And fix the documentation while at it, which was incorrect code.
Diffstat (limited to 'scripts/Dpkg')
-rw-r--r--scripts/Dpkg/Conf.pm4
-rw-r--r--scripts/Dpkg/Substvars.pm4
2 files changed, 4 insertions, 4 deletions
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);
}
}