On Mon, Nov 15, 2004 at 12:06:55PM +0000, Brian McCauley wrote:
> 
> 
> Yitzchak Scott-Thoennes wrote:
> >On Sat, Nov 13, 2004 at 11:56:27AM +0000, Brian McCauley wrote:
> >
> >>David Nichol is not talking nonsense, he is right
> >>
> >> $foo =~ 'literal';
> >>
> >>...is correctly parsed as ...
> >>
> >> $foo =~ EXPR
> >
> >
> >Nope; if it were, it *would* be subject to needing use re "eval"; the
> >problem is that currently
> >
> >   $foo =~ 'literal';
> >
> >is silently treated like
> >
> >   $foo =~ /literal/;
> 
> So what you are saying is that 'use re "eval";' setting is implicitly on 
> during constant folding and is not what one would consider the "Right 
> Thing(TM)".

Not exactly; I'm saying that $foo =~ EXPR never requires a use re "eval"
if EXPR is a constant or something that folds to a constant.  matching
isn't actually done during constand folding.
 
> OK, I can see that that is true but I cannot conceive a real-world 
> situation where this would ever matter.  Actually, IIRC, it's just one 
> of many lexically-scope pramas that don't get applied correctly during 
> constant folding some of which do have real-world consequences.
> 
> You describe this behaviour as "the problem" which presumably means that 
> you _can_ see a situation where perl spuriously enabling 'use re 
> "eval";' during constant folding would matter.  Could you give an 
> example please.

By "the problem", I meant that it is an existing behaviour where
preserving backward compatibility makes it harder for Dave to do his
long-awaited fix for (?{ })'s variable binding.  I didn't mean to say
that the behaviour is buggy.

Reply via email to