]> git.vpit.fr Git - perl/modules/Sub-Op.git/commitdiff
Add a sample shortcut to Sub::Op::Test
authorVincent Pit <vince@profvince.com>
Fri, 1 Jan 2010 17:46:07 +0000 (18:46 +0100)
committerVincent Pit <vince@profvince.com>
Fri, 1 Jan 2010 17:46:07 +0000 (18:46 +0100)
MANIFEST
samples/try.pl [new file with mode: 0755]

index 3764369ce848c4a5d196f560a7bc8df4afabba79..bd448635d892ae19fb015bbecd5eaf611572e9cd 100644 (file)
--- 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 (executable)
index 0000000..399dbb9
--- /dev/null
@@ -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 $@;