X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Prototype-Util.git;a=blobdiff_plain;f=samples%2Ftry.pl;h=250ff60aeba64d4bd332ef6656dcc303cd81d060;hp=c9fbe0733b909fb431d286835a94aa3080cbdbcc;hb=bddf69cf5d7e479af6e609e493f344c3b191e69a;hpb=812065270f1262b670f91bc7de80f67c583a123e diff --git a/samples/try.pl b/samples/try.pl index c9fbe07..250ff60 100755 --- a/samples/try.pl +++ b/samples/try.pl @@ -7,7 +7,7 @@ use Data::Dumper; use lib qw{blib/lib}; -use Sub::Prototype::Util qw/flatten recall/; +use Sub::Prototype::Util qw/flatten recall wrap/; my @a = qw/a b c/; print "At the beginning, \@a contains :\n", Dumper(\@a); @@ -21,3 +21,8 @@ print "When flatten with prototype $proto, this gives :\n", Dumper(\@flat); recall 'CORE::push', @args; # @a contains 'a', 'b', 'c', 1, { d => 2 }, undef, 3 print "After recalling CORE::push with \@args, \@a contains :\n", Dumper(\@a); + +my $splice = wrap 'CORE::splice', compile => 1; +my @b = $splice->(\@a, 4, 2); +print "After calling wrapped splice with \@a, it contains :\n", Dumper(\@a); +print "What was returned :\n", Dumper(\@b);