Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #38208] Can't Escape Single Quotes in Strings

0 views
Skip to first unread message

Matt Diephouse

unread,
Jan 11, 2006, 11:24:42 PM1/11/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Matt Diephouse
# Please include the string: [perl #38208]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38208 >


Backslashes don't escape single quotes in strings:

mdiep@dissonance:~/parrot$ cat test.pir
.sub main :main
$S0 = 'baz\'s bar'
end
.end
mdiep@dissonance:~/parrot$ parrot test.pir
error:imcc:syntax error, unexpected IDENTIFIER, expecting '\n'
in file 'test.pir' line 2
mdiep@dissonance:~/parrot$

This would be useful for avoiding backslash escaping hell:

$S0 = ".throw(\"can't read \\\"foo\\\": variable isn't array\")"

vs.

$S0 = ".throw('can\'t read \"foo\": variable isn\'t array')"

--
matt diephouse
http://matt.diephouse.com

0 new messages