What extra call? q{} gets compiled to a sub, so leave(enter()) was already present.
Furthermore — and my whole point — the subs now close over lexicals @short, @none and @long, whereas the q{} code used @main::short, @main::none and @main::long, all of which were empty. You could use our @short, etc as an alternative, but when I suggested that in the past, it seemed to confuse people.
Update: oh! I see the code is not compiled into a sub:
if (ref $c eq 'CODE') {
$subcode = "sub { for (1 .. $n) { local \$_; package $pack; &\$c;
+} }";
$subref = eval $subcode;
}
else {
$subcode = "sub { for (1 .. $n) { local \$_; package $pack; $c;} }
+";
$subref = _doeval($subcode);
}
You'd think that would be mentioned somewhere prominant in the documentation. I can only find a mention in a footnote on another topic.
|