> > =item perl6storm #0064
> >
> > Do something about microsoft's CRLF abomination.
>
> I think for the case of Microsoft C++ used for the Win32 port, everyone
> would be happy if Perl's sysopen, sysread, etc. did not require binmode.
> Unfortunately, Microsoft made the decision very early on in its C/C++
> development to make open, read, etc. do CRLF/NL conversions.  To do this I
> think that you need to substitute the Win32 API calls like
> OpenFile for the
> calls to open, read, etc.  Unfortunately, I'm too backed up right now to
> even come close to making this change.

Umm... Isn't it possible already, via use of the input record seperator, $/
?
Though use of this means you need to figure out whether or not it includes
Windows text before reading in... Granted I've never tried it this way, I
usually use the (evil):

        while (<FH>) {
                s/^M$//;
                # Process $_
        }

Perhaps somehow allowing $/ to take multiple input delimeters (perhaps in a
fashion similar to egrep)... How about:

        $/ = "seperator1|seperator2";

might be a possible way of doing it... granted it looks a little nasty...
And if you want to have '|' as a delimitor, escaping it with a \ would be
required, etc. so you could conceivably end up with code like:

        $/ = "\||\\";

to delimit on '|' or '\'...

Hmm... I'm defeating my own idea... Perhaps I should just shut up and let
others do it as well... :)

Greg

Reply via email to