develooper Front page | perl.perl5.porters | Postings from November 1999

Re: [ID 19991118.014] Error producing ^\ (chr 28) with "\c\\"

Thread Previous | Thread Next
From:
Philip Newton
Date:
November 23, 1999 01:27
Subject:
Re: [ID 19991118.014] Error producing ^\ (chr 28) with "\c\\"
Message ID:
Pine.LNX.4.04.9911230449150.3104-100000@ficus.frogspace.net
On Fri, 19 Nov 1999, Ilya Zakharevich wrote:

> On Fri, Nov 19, 1999 at 11:17:03AM -0500, Philip Newton wrote:
> > > And what would "\c\c\c\c\\" do, in your opinion? ;-)
> > 
> > My guess is ^\ + 'c' + ^\ + 'c' + '\\', i.e. ASCII 28, 99, 28, 99, 92. And
> > that's what Perl does.
> 
> So you want it to be parsed left-to-right.  But you want \c\\ to be
> parsed right-to-left.  Choose one.

Not quite. I want '\\' to be translated to \ in a previous pass, before
the \c mechanism sees it. After the '\\' -> \ pass, I want left-to-right.

> > This still doesn't explain to me, though, hough to produce a string
> > consisting solely of the character ^\.
> 
> TIMTOWTDI.  chr(ord('\\')-62) (or is it 32?) is one of them.

Well, and "\0x1c" and "\034" work, of course. I was just disappointed that
ctrl-\ seems to be the only character that's difficult to produce in \c
notation.

Cheers,
Philip


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