perl -we 'use Safe; use Safe::Hole; printf("%s, %s\n", $Safe::VERSION, $Safe::Hole::VERSION); use JSON; my $safe = Safe->new; my $hole = new Safe::Hole {}; sub w() { print "In wrapped w() subroutine.\n"; return $hole->wrap(JSON->new); } $hole->wrap(\&w, $safe, "&w"); print "This should fail:\n"; $safe->reval("sub x { return \&w; } f(x());"); print "It succeeded\n" unless($@);'