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:
Ilya Zakharevich
Date:
November 26, 1999 23:24
Subject:
Re: [ID 19991118.014] Error producing ^\ (chr 28) with "\c\\"
Message ID:
19991127022406.B19852@monk.mps.ohio-state.edu
On Fri, Nov 26, 1999 at 07:26:36AM -0500, Philip Newton wrote:
> > you are missing the *most important* point again: closing " is found first.
> 
> Yes, but according to perlop/Gory Details, while searching for the closing
> " of "" (or closing ^ of qq^^, etc.), the combinations \\ and \" (or \^,
> etc.) are skipped. Hence, according to my understanding, "\c\\" (after the
> first "pass", finding the end) turns into >>\c\\ inside ""<<; "\c\"" into
> >>\c\" inside ""<<; and qq^\c\^^ into >>\c\^ inside qq^^<<.
> 
> After this, backslash+delimiter are turned into plain delimiter (while
> backslash+backslash is kept), and knowledge of the original delimiter is 
> lost, so the three strings become \c\\, \c" and \c^, respectively.

This is how I would expect things work.

> Hmmm, I think I begin to understand. No change is needed for
> control-(closing delimiter), since the interpolation step doesn't see
> backslashes there any more. However, I still believe that handling of \c\\
> should be changed to produce ctrl-\ instead of ctrl-\, \.

This will break compatibility with

   $x = 'whatever';
   /$x/;

It is not win-win situation.  Being such, I do not feel any urge to
have it changed.

Ilya

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