use blib 't/Sub-Op-Test';
my $code = $ARGV[0];
-die "Usage: $0 'code involving f()'" unless defined $code;
+die "Usage: $0 'code involving f() and g()'" unless defined $code;
-eval <<"CODE";
+my $cb = eval <<"CODE";
use Sub::Op::Test f => sub { say 'f(' . join(', ', \@_) . ')'; \@_ };
- $code
+ use Sub::Op::Test g => sub { say 'g(' . join(', ', \@_) . ')'; \@_ };
+ sub { $code }
CODE
die $@ if $@;
+
+print "--- run ---\n";
+eval { $cb->() };
+warn "exception: $@" if $@;
+
+print "--- deparse ---\n";
+use B::Deparse;
+print B::Deparse->new->coderef2text($cb), "\n";
+
+print "--- concise ---\n";
+use B::Concise;
+B::Concise::compile($cb)->();
+
+print "--- concise(exec) ---\n";
+B::Concise::compile('-exec', $cb)->();