On Fri, Feb 21, 2003 at 08:25:56AM +0200, Jarkko Hietaniemi wrote: > > > > Bleadperl or 5.8.0: > > > > > > > > $ ./perl -e 'local ${"FOO"}=1' > > > > Can't localize through a reference at -e line 1. > > > > $ > > > > > > > > What reference where? > > > > Ronald J Kimball <rjk@linguist.Thayer.dartmouth.edu>: > > > That's a symbolic reference, isn't it? > > Syntactically yes, but semantically it isn't, all that needs to be > known about the variable name is known in compiletime. In other > words, I would have expected the above to be equivalent to ${FOO} > or $FOO. > > > Mark-Jason Dominus: > > Perhaps the best way to address this would be to extend the peephole > > optimizer to optimize ${"COMPILE_TIME_CONSTANT"} to > > $COMPILE_TIME_CONSTANT. > > Yup, something like that. This cannot go without making lexical variables accessible through symbolic references. I don't think it would be acceptable that '$a="b"; $$a' and '${"b"}' work differently ( since ${"b"} would be optimized to $b, it will access the lexical in the first place, unlike $$a ). IMO, it's preferable to keep the old behavior. Regards AdiThread Previous | Thread Next