$sub1 = sub {Here, the call to $clo2 will print "OK?", then "Hi!", then the second attempt to call sub1() will fail because it's not defined (we localized the typeglob within $clo2).
print "Hi!\n";
};
$clo2 = sub {
print "OK?\n";
local *sub1 = $sub1;
sub1();
};
$clo2->();
sub1();
This is how I've implemented subroutines in Semantics::Code.
No comments:
Post a Comment