it's intended to allow an unlimited number of vars
Arguments do allow that. It seems that what you want is named arguments. Maybe you should use Sub::Parameters or something like that.
You're striving for the awkward
but the following is clearer:my $c; thing { ... ... $c ... ... } $c;
thing { my $c : Parameter; ... ... $c ... ... };
and as a side note $a and $b could be tied too.
So? I've already shown you how to completely localise a package variable.
The advantage of $a, $b and $_ is that you don't need to declare them.
As I said, forbidding tied vars is a good and pragmatic solution to get around this edge case.
There are a lot more magic variables than just tied ones, but you're not likely to find them on lexicals without putting it on them explicitly.
You'll also clobber dualvars and vars' pos().
In reply to Re^9: localizing lexical without messing with tie ?
by ikegami
in thread localizing lexical without messing with tie ?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |