1N/A# Note : we're not using t/test.pl here, because we would need 1N/A# fresh_perl_is, and fresh_perl_is uses a closure -- a special 1N/A# case of what this program tests for. 1N/A if (s/^\s*(-\w+)//){ 1N/A # allow expected output to be written as if $prog is on STDIN 1N/A print "ok ", ++$i, "\n"; 1N/Aeval "sub #foo\n{print 1}"; 1N/A print "ok ", ++$i, "\n"; 1N/A print "not ok ", ++$i, "\n# GOT: $@"; 1N/A my $dummy = $n; # eval can't close on $n without internal reference 1N/A eval 'sub { print $n }'; 1N/A eval 'sub Y { my $p = shift; $p->() }'; 1N/A Y(sub { print $n }); 1N/Aprint sub { return "ok 1\n" } -> ();