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
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