> While doing a close eyeball lint of a misbehaving complex rule, I noticed
> I had made a rather subtle typo:
>     mumble{x,y]mumble
> Note the closing _square_ bracket. I guess I missed the [SHIFT] key... :)
> 
> This did not generate any lint or runtime errors.
> 
> Any idea why? I would expect the perl RE engine to have a problem with
> unbalanced curly braces like that, but a quick test shows it does not (at
> least, not in 5.8.8)! I would have thought you'd have to escape a curly
> brace to match it literally, just like you do square brackets...
> 
> Does this deserve any special checking, like the || test? If so, I'll open
> a bug. Or might it be a bug in perl's RE parser?

It is not an error. Perl is just too damn smart, and understands that
you 'meant' a literal '{' when it is not closed. There are other similar
cases, like unquoted $ or #, etc.

> Does this deserve any special checking, like the || test?

I don't think so, otherwise we could end up re-implementing the perl
expression parsing. I have my doubts on a need for '||' hand-holding,
but never mind.

  Mark

Reply via email to