Browse Source

Dpkg: Call anonymous subs via -> operator instead of casting with &

And fix the documentation while at it, which was incorrect code.
Guillem Jover 7 years ago
parent
commit
667b38f6a4
3 changed files with 6 additions and 4 deletions
  1. 2 0
      debian/changelog
  2. 2 2
      scripts/Dpkg/Conf.pm
  3. 2 2
      scripts/Dpkg/Substvars.pm

+ 2 - 0
debian/changelog

@@ -15,6 +15,8 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
     - Add new import tags for Dpkg::Arch.
     - Abort on EOF in patch name prompt in Dpkg::Source::Package::V2,
       instead of getting into an infinite loop. Closes: #851441
+    - Call anonymous subs via -> operator instead of casting with &, and fix
+      bogus POD documentation to match the code.
   * Documentation:
     - Cleanup software requirements in README.
     - Move control member file references from dpkg(1) to deb(5).

+ 2 - 2
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}};
 }
 

+ 2 - 2
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);
     }
 }