On Fri, 6 Dec 2002, Joseph F. Ryan wrote:
>
> What's wrong with single quoted here-docs?

What's wrong is that the documentation team is trying to allow \qq[]
there too, contradicting their own assertion that backslashes are not
special in that context.

> Don't forget that the backslash is already special in
> non-interpolating strings; I don't think that adding a single
> special case will make things too confusing.
>
> >What if \q[] was allowed in interpolated strings, but not in
> >non-interpolated strings.  Then I'm happy with that non-interpolated
> >strings really don't interpolate, and you might be happy because it would
> >only make sense to do one level of nesting. ie, you cannot embed \qq[]
> >inside \q[].  Or you could do $(''), which is the same number of
> >characters as \qq[], and doesn't require introducing
> >yet-another-new-rule-to-an-already-too-complicated-escaping-system.
>
> I think \qq[] is the much more useful of the two, so
> that really doesn't help much.

Oh well, I'm being overly-speculative above, which I shouldn't do on this
list, but I was wondering if compromise was possible.  Changing the
behavior of backslashes and balanced delimiters is also speculative.

The current behavior in perl5 is that only two sequences are special in
non-interpolated strings

   \\ --> \
   \<delim> --> <delim>

<delim> can be either the opening or closing delimiter when they are
balanced.  So you CAN backslash them, but I don't HAVE to.

Larry has added \qq[] and \q[], so "\q" is now special.  (Are \qw[] and
\qx[] in?  qw doesn't make sense, and qx might be insecure.)


I would really appreciate a ruling from the design team before we change
non-interpolative semantics regarding:

1) the interpretation of \<anything-else>,
   PRO: it makes backslash behavior consistent
   CON: the perl5 behavior is as unobtrusive as possible

2) requiring balanced delimiters to be escaped,
   PRO: it's consistent with non-balanced delimiter requirements
   CON: you already can; don't force it those who don't want it

3) allowing \qq[] in single-quoted here-docs.
   PRO: it's consistent with single-quotes
   CON: it contradicts the assertion that backslashes are not special in
single quoted here-docs
        we need a quoting mechanism where NOTHING is special

(Those are ordered from least to most offensive, BTW.)

~ John Williams



Reply via email to