From: Vincent Pit Date: Fri, 1 Jan 2010 17:46:07 +0000 (+0100) Subject: Add a sample shortcut to Sub::Op::Test X-Git-Tag: v0.01~19 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=4c1ada5fa7e7a266479669bdcaa60b33ada4c9c1;p=perl%2Fmodules%2FSub-Op.git Add a sample shortcut to Sub::Op::Test --- diff --git a/MANIFEST b/MANIFEST index 3764369..bd44863 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,6 +7,7 @@ README configure_test.pl lib/Sub/Op.pm sub_op.h +samples/try.pl t/10-base.t t/Sub-Op-Test/Makefile.PL t/Sub-Op-Test/Test.xs diff --git a/samples/try.pl b/samples/try.pl new file mode 100755 index 0000000..399dbb9 --- /dev/null +++ b/samples/try.pl @@ -0,0 +1,18 @@ +#!perl + +use 5.010; + +use strict; +use warnings; + +use blib; +use blib 't/Sub-Op-Test'; + +my $code = $ARGV[0]; +die "Usage: $0 'code involving f()'" unless defined $code; + +eval <<"CODE"; + use Sub::Op::Test f => sub { say 'f(' . join(', ', \@_) . ')'; \@_ }; + $code +CODE +die $@ if $@;