]> git.vpit.fr Git - perl/modules/Sub-Prototype-Util.git/blobdiff - lib/Sub/Prototype/Util.pm
Make sure the POD headings are linkable
[perl/modules/Sub-Prototype-Util.git] / lib / Sub / Prototype / Util.pm
index 2c47ba649acfc266dd06c964ba4f4451f2ff94a1..a981d27498ac393d4d383c8c39d2af27e8190c49 100644 (file)
@@ -14,13 +14,13 @@ Sub::Prototype::Util - Prototype-related utility routines.
 
 =head1 VERSION
 
-Version 0.09
+Version 0.10
 
 =cut
 
 use vars qw<$VERSION>;
 
-$VERSION = '0.09';
+$VERSION = '0.10';
 
 =head1 SYNOPSIS
 
@@ -72,7 +72,9 @@ sub _clean_msg {
  $msg;
 }
 
-=head2 C<flatten $proto, @args>
+=head2 C<flatten>
+
+    my @flattened = flatten($proto, @args);
 
 Flattens the array C<@args> according to the prototype C<$proto>.
 When C<@args> is what C<@_> is after calling a subroutine with prototype C<$proto>, C<flatten> returns the list of what C<@_> would have been if there were no prototype.
@@ -118,7 +120,10 @@ sub flatten {
  return @args;
 }
 
-=head2 C<wrap $name, %opts>
+=head2 C<wrap>
+
+    my $wrapper = wrap($name, %opts);
+    my $wrapper = wrap({ $name => $proto }, %opts);
 
 Generates a wrapper that calls the function C<$name> with a prototyped argument list.
 That is, the wrapper's arguments should be what C<@_> is when you define a subroutine with the same prototype as C<$name>.
@@ -132,7 +137,7 @@ In this case, C<$name> must be a hash reference that holds exactly one key / val
 
     my $push = wrap { 'CORE::push' => '\@$' }; # only pushes 1 arg
 
-Others arguments are seen as key / value pairs that are meant to tune the code generated by L</wrap>.
+The remaining arguments C<%opts> are treated as key / value pairs that are meant to tune the code generated by L</wrap>.
 Valid keys are :
 
 =over 4
@@ -279,7 +284,10 @@ sub wrap {
  return $call;
 }
 
-=head2 C<recall $name, @args>
+=head2 C<recall>
+
+    my @res = recall($name, @args);
+    my @res = recall({ $name => $proto }, @args);
 
 Calls the function C<$name> with the prototyped argument list C<@args>.
 That is, C<@args> should be what C<@_> is when you call a subroutine with C<$name> as prototype.