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

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

Thread Previous | Thread Next
November 23, 1999 11:27
Re: [ID 19991118.014] Error producing ^\ (chr 28) with "\c\\"
Message ID:
Cc'd to:

In article <>,
Larry Wall <> wrote:
>It would have to be done in the same pass, by pretending that \c is a
>funny kind of \.

At last, someone with a glimmer of sense!  \c *already* is a funny
kind of \.  Except with respect to whichever character indicates the
end of the quoted string.  This inconsistency is a *bug*.

For instance:

$foo = 'bar'; print "\c$foo";     yields 'dfoo', not an error
$foo = 'bar'; print "\c\$foo";    yields chr(28).'bar', not 'dfoo'

From this, "\c\" should yield chr(28).
And "\c"" should yield 'b', just as qq'\c"' does.

Alternatively, \c\ should always apply the \c 'operator' to the
following character, so that "\c\"" works like qq'\c"' (as it
currently does) but it takes \c\\ to get a chr(28).

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About