X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=samples%2Ftry.pl;h=3c4426dad89d14377d5fec96474b61e57a0988b1;hb=HEAD;hp=c9fbe0733b909fb431d286835a94aa3080cbdbcc;hpb=4b145ee918e94698fe49c6e9240d50cfb2a36c75;p=perl%2Fmodules%2FSub-Prototype-Util.git diff --git a/samples/try.pl b/samples/try.pl index c9fbe07..3c4426d 100755 --- a/samples/try.pl +++ b/samples/try.pl @@ -5,11 +5,11 @@ use warnings; use Data::Dumper; -use lib qw{blib/lib}; +use lib qw; -use Sub::Prototype::Util qw/flatten recall/; +use Sub::Prototype::Util qw; -my @a = qw/a b c/; +my @a = qw; print "At the beginning, \@a contains :\n", Dumper(\@a); my @args = ( \@a, 1, { d => 2 }, undef, 3 ); @@ -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'; +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);