develooper Front page | perl.perl5.porters | Postings from July 2009

Re: [perl #62056] Variable expansion in same regex as \N{} escape results in compilation error.

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
July 17, 2009 01:02
Subject:
Re: [perl #62056] Variable expansion in same regex as \N{} escape results in compilation error.
Message ID:
b77c1dce0907170102s417278fewe1ed338d144e535a@mail.gmail.com
2009/7/16 Michael G Schwern <schwern@pobox.com>:
> Oddly enough, this is a case where a wild stretch of backwards compatibility
> was broken.
>
> $ perl5.5.5 -wle 'print "\N{FOO}"'
> N{FOO}
>
> $ perl5.6.1 -wle 'print "\N{FOO}"'
> Constant(\N{...}) unknown: (possibly a missing "use charnames ...") at -e line
> 1, within string
> Execution of -e aborted due to compilation errors.
>
> BUT WHAT IF SOMEONE WAS USING "\N{BLAH}" IN THEIR CODE?!
>
> *ahem*

Seriously, this is getting a bit tiresome. I don't know from where did
originate this myth of P5P being opposed to any form of compatibility
breakage, but it's a myth. A not a much flattering one. No dragons are
slain in it. (or vampires)

Did you notice that I recently added meaning for \N alone in regexes ?
(the opposite of /\n/, for the record.) And what it someone was using
it before ?

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About