On Fri, 22 Sep 2000, Greg Boug wrote:

> > > =item perl6storm #0064
> > >
> > > Do something about microsoft's CRLF abomination.
> 
> Perhaps somehow allowing $/ to take multiple input delimeters (perhaps in a
> fashion similar to egrep)... How about:
[snip] 
>       $/ = "seperator1|seperator2";
> 
> [snip] so you could conceivably end up with code like:
>       $/ = "\||\\";
> to delimit on '|' or '\'...

        Alternatively, we make it work like '-' in a character class...if
it's the first character, the RE knows that you want it to a literal
hyphen.  If used between two characters, you want a range (or, in this
case, an alternative).  So:

        $/ = "||foo" would mean 'delimited by a pile for by the sequence
foo'

        Similarly (although this one might be a lot nastier from an
-internals viewpoint), we could say that, if the final " is immediately
preceded by an '\', then clearly what you wanted was a literal backslash.
(That is, "\" would not produce a runaway string...hmmm, that's a good
idea all by itself, actually.)

        Assuming that both of these ideas were implemented, then you could
write:

        $/ = "||\" and it would DWYM.  

                                Dave

Reply via email to