Re: What should /\08/ match and do?
[email protected] (Nicholas Clark)
| Newsgroups | perl.perl5.porters |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jun 01, 2010 at 01:13:33PM +0200, Abigail wrote:
> On Fri, May 28, 2010 at 10:16:59AM -0600, karl williamson wrote:
> > I thought I knew the answer to this, but am now not so sure.
> >
> > I thought it should match a NUL followed by a digit 8. That is what it
> > does now, although it raises the false error message "Illegal octal
> > digit '8' ignored". This is false because it isn't ignored.
> >
> > I thought I would just silence the message; but it occurs to me that it
> > would be very unlikely for someone to want to match a NUL followed by
> > anything else; or is that my C-centric thinking? /\0A/ matches NUL
> > followed by A with no message.
> >
> > Anyway I'd see if someone else had any opinions on this.
>
>
> I think /\08/ should match NUL followed by 8. I do not know what else
> it should match, and just giving up and refusing to do anything because
> the programmer might have meant something else seems very unPerlish to me.
>
> I agree the warning could use some rewording though. Perhaps a "/\08/
> interpreted as /\x{00}8/" kind of warning, but that may not be as easy
> as it sounds.
I'm with Abigail in that I don't think that it should be silent, as there's
a latent bug if \07 is edited to \08, or vice versa.
Nicholas Clark