Here's my partial TODO list for perl 5.10.
Do operators that default to $_ then use $::_ or the new lexical $_?Allow the syntax my($_) so it creates a brand new lexical variable $_. (local($_) doesn't create a new lexical variable, since it only lexicalises the value, but doesn't remove the magic from the previous $_.)
Will it also be possible to have lexical $/, STDIN, ARGV and $<? How do they work?
Please also allowWhile we're at it, allow the syntax readpipe PROGRAM LIST, similar to system PROGRAM LIST, to prevent shell interpolation.
readpipe LIST
, like system LIST
.
re II
rafael on 2003-12-03T23:16:42
Lexical $_ : the real goal is to have the built-ins take the lexical $_ if there's any currently in scope. (It's trivial to permit the syntax "my $_" but it's useless if the interpreter doesn't catch up.)I don't see how a lexical $/ etc. would be useful. The purpose of a lexical $_ is precisely to ensure that $_ is a plain, regular scalar, keeping it away from the influences of outer scopes. Surely you don't want to remove magic from $/.
The readpipe LIST syntax was, of course, implied in my terse notes.