develooper Front page | perl.perl6.documentation | Postings from December 2002

Re: String Literals, take 3

Thread Previous | Thread Next
From:
Joseph F. Ryan
Date:
December 5, 2002 12:23
Subject:
Re: String Literals, take 3
Message ID:
3DEFB5D4.908@osu.edu
Peter Haworth wrote:

>On Thu, 5 Dec 2002 04:05:05 -0500, Tanton Gibbs wrote:
>  
>
>>>A string inside a \qq[] construct acts exactly as if it were an
>>>interpolated string. Note that any end-brackets, "]", must be escaped
>>>within the the \qq[] construct so that the parser can read it correctly.
>>>      
>>>
>>Note that an end-bracket, ], must be escaped within the \qq[] construct.
>>This allows the parser to correctly parse the construct.
>>    
>>
>
>Don't embedded qq[] strings obey the normal qq[] rules? That is, will
>all brackets need escaping, or just unbalanced brackets? I'd hope for
>the latter.
>

With all of the new crazy quoting shenanagains, I'm not sure that the
"balenced brackets are fine" rule will still be possible; and thus end
delimeters will always need to be escaped.  For instance, imagine
what a nightmare this would be to parse:

$var = qq[blah [\q[blah [\qq[%hash{qq[[hi]]}]]]] blah];

Sure, anyone who writes something like this deserves to be shot;
however, if the "balanced brackets are ok" rule still stands, the
above code would be legal.  (And I really, really, really don't
want the above code to be legal ;)


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