Mark Jason Dominus <mjd@plover.com> wrote: > Rafael Garcia-Suarez <rgarciasuarez@free.fr>: > > Mark Jason Dominus <mjd@plover.com> wrote: > > > > > > Perhaps the best way to address this would be to extend the peephole > > > optimizer to optimize ${"COMPILE_TIME_CONSTANT"} to > > > $COMPILE_TIME_CONSTANT. > > > > While not breaking strict 'refs.' As says perlref : > > > > use strict 'refs'; > > ${ bareword }; # Okay, means $bareword. > > ${ "bareword" }; # Error, symbolic reference. > > I'm not quite sure what your point is here, but I would say that if > strict 'refs' complains about ${"word"} when "word" is a compile-time > constant, it is defective, and my suggestion will make it less so. This point can be discussed with good arguments on both sides. However, this enhancement to the optimizer will not allow things like no strict 'refs'; local ${ some_expr_that_evaluates_to_a_string() }; which in my opinion are harmless, unlike "local $$x" where $x is actually a reference. (although I need some experiments to convince myself of that)Thread Previous