On Mon, 18 Jul 2005 20:28:58 -0700, Yitzchak Scott-Thoennes wrote:

> On Sun, Jul 17, 2005 at 11:38:05AM +0900, SADAHIRO Tomoyuki wrote:
> > \c\ is an only case (afaik) of escape sequence ending with backslash.
> > Though perlop explains how to find the end of quoted constructs
> > in detail, it may be a trap.
 
> I've long considered this a bug.  I'd rather not document it, or
> document it explicitly as a bug.  IMO "finding the end" is
> inconsistent with later processing, and \c\ should be treated as a
> complete character.

Certainly this may be something like a bug or a limitation.
However \c\ is invalid in single-quoted constructs, and a fix
that will make qq/\c\/ valid should not make q/\c\/ valid.

According to "the gory details", interpretation of metacharacters
and variables seems to be delayed till the step of interpolation.

Though I don't know why the interpretation is performed after
the extraction of delimiter-independent texts (by finding the end
and removal of backslashes before delimiters), I suppose that,
if someone will try to make qq/\c\/ valid,
not only interpretation of \c\ but also any kind of interpolation
may need to be performed at the step of finding the end.

When finding the end and interpolation are performed at the same time,
what is wrong? It's difficult, and I don't know the answer.
An answer may be the case that backslashs are used as delimiters:
if any combinations of a backslash followed by any character would
be valid metacharacters, qq\......... couldn't be terminated.

Regards,
SADAHIRO Tomoyuki


Reply via email to