]> git.vpit.fr Git - perl/modules/Sub-Prototype-Util.git/commitdiff
POD verbatim paragraphs should fit into a terminal
authorVincent Pit <vince@profvince.com>
Fri, 23 Aug 2013 19:33:09 +0000 (16:33 -0300)
committerVincent Pit <vince@profvince.com>
Fri, 23 Aug 2013 19:33:09 +0000 (16:33 -0300)
lib/Sub/Prototype/Util.pm

index a981d27498ac393d4d383c8c39d2af27e8190c49..011d1c2ad922841b0dde34b09a4482d978a51611 100644 (file)
@@ -29,10 +29,17 @@ $VERSION = '0.10';
     my @a = qw<a b c>;
     my @args = ( \@a, 1, { d => 2 }, undef, 3 );
 
-    my @flat = flatten '\@$;$', @args; # ('a', 'b', 'c', 1, { d => 2 })
-    recall 'CORE::push', @args; # @a contains 'a', 'b', 'c', 1, { d => 2 }, undef, 3
+    my @flat = flatten '\@$;$', @args;
+    # @flat contains now ('a', 'b', 'c', 1, { d => 2 })
+
+    my $res = recall 'CORE::push', @args;
+    # @a contains now 'a', 'b', 'c', 1, { d => 2 }, undef, 3
+    # and $res is 7
+
     my $splice = wrap 'CORE::splice';
-    my @b = $splice->(\@a, 4, 2); # @a is now ('a', 'b', 'c', 1, 3) and @b is ({ d => 2 }, undef)
+    my @b = $splice->(\@a, 4, 2);
+    # @a contains now ('a', 'b', 'c', 1, 3)
+    # and @b is ({ d => 2 }, undef)
 
 =head1 DESCRIPTION
 
@@ -170,7 +177,8 @@ Defaults to true, but turned off when C<sub> is false.
 For example, this allows you to recall into C<CORE::grep> and C<CORE::map> by using the C<\&@> prototype :
 
     my $grep = wrap { 'CORE::grep' => '\&@' };
-    sub mygrep (&@) { $grep->(@_) } # the prototypes are intentionally different
+    # the prototypes are intentionally different
+    sub mygrep (&@) { $grep->(@_) }
 
 =cut