MLEHMANN ignores Perl newer than 5.22, disable feature signatures

indirect method invocation is deprecated

Index: AIO.pm
--- AIO.pm.orig
+++ AIO.pm
@@ -26,7 +26,7 @@ IO::AIO - Asynchronous/Advanced Input/Output
  $req->cancel; # cancel request if still in queue
 
  my $grp = aio_group sub { print "all stats done\n" };
- add $grp aio_stat "..." for ...;
+ $grp->add(aio_stat "...") for ...;
 
 =head1 DESCRIPTION
 
@@ -168,6 +168,7 @@ package IO::AIO;
 
 use Carp ();
 
+no feature 'signatures';
 use common::sense;
 
 use base 'Exporter';
@@ -931,15 +932,15 @@ sub aio_load($$;$) {
    my $grp = aio_group $cb;
 
    aioreq_pri $pri;
-   add $grp aio_open $path, O_RDONLY, 0, sub {
+   $grp->add(aio_open $path, O_RDONLY, 0, sub {
       my $fh = shift
          or return $grp->result (-1);
 
       aioreq_pri $pri;
-      add $grp aio_read $fh, 0, (-s $fh), $$data, 0, sub {
+      $grp->add(aio_read $fh, 0, (-s $fh), $$data, 0, sub {
          $grp->result ($_[0]);
-      };
-   };
+      });
+   });
 
    $grp
 }
@@ -970,62 +971,62 @@ sub aio_copy($$;$) {
    my $grp = aio_group $cb;
 
    aioreq_pri $pri;
-   add $grp aio_open $src, O_RDONLY, 0, sub {
+   $grp->add(aio_open $src, O_RDONLY, 0, sub {
       if (my $src_fh = $_[0]) {
          my @stat = stat $src_fh; # hmm, might block over nfs?
 
          aioreq_pri $pri;
-         add $grp aio_open $dst, O_CREAT | O_WRONLY | O_TRUNC, 0200, sub {
+         $grp->add(aio_open $dst, O_CREAT | O_WRONLY | O_TRUNC, 0200, sub {
             if (my $dst_fh = $_[0]) {
 
                # best-effort preallocate
                aioreq_pri $pri;
-               add $grp aio_allocate $dst_fh, IO::AIO::FALLOC_FL_KEEP_SIZE, 0, $stat[7], sub { };
+               $grp->add(aio_allocate $dst_fh, IO::AIO::FALLOC_FL_KEEP_SIZE, 0, $stat[7], sub { });
 
                aioreq_pri $pri;
-               add $grp aio_sendfile $dst_fh, $src_fh, 0, $stat[7], sub {
+               $grp->add(aio_sendfile $dst_fh, $src_fh, 0, $stat[7], sub {
                   if ($_[0] == $stat[7]) {
                      $grp->result (0);
                      close $src_fh;
 
                      my $ch = sub {
                         aioreq_pri $pri;
-                        add $grp aio_chmod $dst_fh, $stat[2] & 07777, sub {
+                        $grp->add(aio_chmod $dst_fh, $stat[2] & 07777, sub {
                            aioreq_pri $pri;
-                           add $grp aio_chown $dst_fh, $stat[4], $stat[5], sub {
+                           $grp->add(aio_chown $dst_fh, $stat[4], $stat[5], sub {
                               aioreq_pri $pri;
-                              add $grp aio_close $dst_fh;
-                           }
-                        };
+                              $grp->add(aio_close $dst_fh);
+                           });
+                        });
                      };
 
                      aioreq_pri $pri;
-                     add $grp aio_utime $dst_fh, $stat[8], $stat[9], sub {
+                     $grp->add(aio_utime $dst_fh, $stat[8], $stat[9], sub {
                         if ($_[0] < 0 && $! == ENOSYS) {
                            aioreq_pri $pri;
-                           add $grp aio_utime $dst, $stat[8], $stat[9], $ch;
+                           $grp->add(aio_utime $dst, $stat[8], $stat[9], $ch);
                         } else {
                            $ch->();
                         }
-                     };
+                     });
                   } else {
                      $grp->result (-1);
                      close $src_fh;
                      close $dst_fh;
 
                      aioreq $pri;
-                     add $grp aio_unlink $dst;
+                     $grp->add(aio_unlink $dst);
                   }
-               };
+               });
             } else {
                $grp->result (-1);
             }
-         },
+         });
 
       } else {
          $grp->result (-1);
       }
-   };
+   });
 
    $grp
 }
@@ -1049,21 +1050,21 @@ sub aio_move($$;$) {
    my $grp = aio_group $cb;
 
    aioreq_pri $pri;
-   add $grp aio_rename $src, $dst, sub {
+   $grp->add(aio_rename $src, $dst, sub {
       if ($_[0] && $! == EXDEV) {
          aioreq_pri $pri;
-         add $grp aio_copy $src, $dst, sub {
+         $grp->add(aio_copy $src, $dst, sub {
             $grp->result ($_[0]);
 
             unless ($_[0]) {
                aioreq_pri $pri;
-               add $grp aio_unlink $src;
+               $grp->add(aio_unlink $src);
             }
-         };
+         });
       } else {
          $grp->result ($_[0]);
       }
-   };
+   });
 
    $grp
 }
@@ -1137,7 +1138,7 @@ sub aio_scandir($$;$) {
 
    # get a wd object
    aioreq_pri $pri;
-   add $grp aio_wd $path, sub {
+   $grp->add(aio_wd $path, sub {
       $_[0]
          or return $grp->result ();
 
@@ -1145,7 +1146,7 @@ sub aio_scandir($$;$) {
 
       # stat once
       aioreq_pri $pri;
-      add $grp aio_stat $wd, sub {
+      $grp->add(aio_stat $wd, sub {
          return $grp->result () if $_[0];
          my $now = time;
          my $hash1 = join ":", (stat _)[0,1,3,7,9];
@@ -1160,7 +1161,7 @@ sub aio_scandir($$;$) {
 
          # read the directory entries
          aioreq_pri $pri;
-         add $grp aio_readdirx $wd, $rdxflags, sub {
+         $grp->add(aio_readdirx $wd, $rdxflags, sub {
             my ($entries, $flags) = @_
                or return $grp->result ();
 
@@ -1214,7 +1215,7 @@ sub aio_scandir($$;$) {
 
             # stat the dir another time
             aioreq_pri $pri;
-            add $grp aio_stat $wd, sub {
+            $grp->add(aio_stat $wd, sub {
                my $hash2 = join ":", (stat _)[0,1,3,7,9];
 
                my $ndirs;
@@ -1231,43 +1232,43 @@ sub aio_scandir($$;$) {
 
                my (@dirs, @nondirs);
 
-               my $statgrp = add $grp aio_group sub {
+               my $statgrp = $grp->add(aio_group sub {
                   $grp->result (\@dirs, \@nondirs);
-               };
+               });
 
-               limit $statgrp $maxreq;
-               feed $statgrp sub {
+               $statgrp->limit($maxreq);
+               $statgrp->feed(sub {
                   return unless @$entries;
                   my $entry = shift @$entries;
 
                   aioreq_pri $pri;
                   $wd->[1] = "$entry/.";
-                  add $statgrp aio_stat $wd, sub {
+                  $statgrp->add(aio_stat $wd, sub {
                      if ($_[0] < 0) {
                         push @nondirs, $entry;
                      } else {
                         # need to check for real directory
                         aioreq_pri $pri;
                         $wd->[1] = $entry;
-                        add $statgrp aio_lstat $wd, sub {
+                        $statgrp->add(aio_lstat $wd, sub {
                            if (-d _) {
                               push @dirs, $entry;
 
                               unless (--$ndirs) {
                                  push @nondirs, @$entries;
-                                 feed $statgrp;
+                                 $statgrp->feed();
                               }
                            } else {
                               push @nondirs, $entry;
                            }
-                        }
+                        });
                      }
-                  };
-               };
-            };
-         };
-      };
-   };
+                  });
+               });
+            });
+         });
+      });
+   });
 
    $grp
 }
@@ -1289,20 +1290,20 @@ sub aio_rmtree($;$) {
    my $grp = aio_group $cb;
 
    aioreq_pri $pri;
-   add $grp aio_scandir $path, 0, sub {
+   $grp->add(aio_scandir($path, 0, sub {
       my ($dirs, $nondirs) = @_;
 
       my $dirgrp = aio_group sub {
-         add $grp aio_rmdir $path, sub {
+         $grp->add(aio_rmdir $path, sub {
             $grp->result ($_[0]);
-         };
+         });
       };
 
-      (aioreq_pri $pri), add $dirgrp aio_rmtree "$path/$_" for @$dirs;
-      (aioreq_pri $pri), add $dirgrp aio_unlink "$path/$_" for @$nondirs;
+      (aioreq_pri $pri), $dirgrp->add(aio_rmtree "$path/$_") for @$dirs;
+      (aioreq_pri $pri), $dirgrp->add(aio_unlink "$path/$_") for @$nondirs;
 
-      add $grp $dirgrp;
-   };
+      $grp->add($dirgrp);
+   }));
 
    $grp
 }
@@ -1419,20 +1420,20 @@ sub aio_pathsync($;$) {
    my $grp = aio_group $cb;
 
    aioreq_pri $pri;
-   add $grp aio_open $path, O_RDONLY, 0, sub {
+   $grp->add(aio_open $path, O_RDONLY, 0, sub {
       my ($fh) = @_;
       if ($fh) {
          aioreq_pri $pri;
-         add $grp aio_fsync $fh, sub {
+         $grp->add(aio_fsync $fh, sub {
             $grp->result ($_[0]);
 
             aioreq_pri $pri;
-            add $grp aio_close $fh;
-         };
+            $grp->add(aio_close $fh);
+         });
       } else {
          $grp->result (-1);
       }
-   };
+   });
 
    $grp
 }
@@ -1568,7 +1569,7 @@ Example:
       print "all stats done\n";
    };
 
-   add $grp
+   $grp->add
       (aio_stat ...),
       (aio_stat ...),
       ...;
@@ -1766,14 +1767,14 @@ C<IO::AIO::REQ> objects:
 
    $grp->add (aio_unlink "...");
 
-   add $grp aio_stat "...", sub {
+   $grp->add(aio_stat "...", sub {
       $_[0] or return $grp->result ("error");
 
       # add another request dynamically, if first succeeded
-      add $grp aio_open "...", sub {
+      $grp->add(aio_open "...", sub {
          $grp->result ("ok");
-      };
-   };
+      });
+   });
 
 This makes it very easy to create composite requests (see the source of
 C<aio_move> for an application) that work and feel like simple requests.
@@ -1808,6 +1809,8 @@ finished will the the group itself finish.
 
 =item add $grp ...
 
+Deprecated.
+
 =item $grp->add (...)
 
 Add one or more requests to the group. Any type of L<IO::AIO::REQ> can
@@ -1877,7 +1880,7 @@ Example:
       my $file = pop @files
          or return;
 
-      add $grp aio_stat $file, sub { ... };
+      $grp->add(aio_stat $file, sub { ... });
    };
 
 =item limit $grp $num
