Philip Newton writes: : Not quite. I want '\\' to be translated to \ in a previous pass, before : the \c mechanism sees it. After the '\\' -> \ pass, I want left-to-right. It would have to be done in the same pass, by pretending that \c is a funny kind of \. We go to great lengths to avoid doing multiple passes in Perl, and when we do do multiple passes, we go to great lengths to hide that fact. For instance, we pretend that regular expressions are interpolated and interpreted just like double-quoted strings, but in fact, the lexer must treat them entirely differently to preserve that illusion, because the regular expression parser does a separate pass after interpolation. Not only must the lexer pass backslashed sequences through to the regular expression parser, but it has to decide which dollar signs indicate something to be interpolated immediately: /$foo/ and which have to be passed through to the regular expression engine: /foo$/ /(foo$|bar$)/ /(?{ $foo += 1 })/ Actually, that last one doesn't need to pass $foo--it could conceivably just pass a pointer to some precompiled code, but I don't think it does. If I recall, it's more like an eval. But anyway, we don't cavalierly add multiple passes to Perl. Multiple passes tend to make things easier for the implementer, but harder for the user. Perl's loyalties lie with the user. LarryThread Previous | Thread Next