10 use Sub::Prototype::Util qw/flatten recall wrap/;
13 print "At the beginning, \@a contains :\n", Dumper(\@a);
15 my @args = ( \@a, 1, { d => 2 }, undef, 3 );
16 print "Our arguments are :\n", Dumper(\@args);
19 my @flat = flatten $proto, @args; # ('a', 'b', 'c', 1, { d => 2 })
20 print "When flatten with prototype $proto, this gives :\n", Dumper(\@flat);
22 recall 'CORE::push', @args; # @a contains 'a', 'b', 'c', 1, { d => 2 }, undef, 3
23 print "After recalling CORE::push with \@args, \@a contains :\n", Dumper(\@a);
25 my $splice = wrap 'CORE::splice';
26 my @b = $splice->(\@a, 4, 2);
27 print "After calling wrapped splice with \@a, it contains :\n", Dumper(\@a);
28 print "What was returned :\n", Dumper(\@b);