This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
•Re: reap fodder
by merlyn (Sage) on Jun 04, 2004 at 18:56 UTC
Re: reap fodder
by runrig (Abbot) on Jun 04, 2004 at 20:34 UTC
    That won't work if you run it on a Windows system. readline (the diamond operator) automatically removes the '\r' under Windows (ActivePerl anyway, I don't know about cygwin), but puts it back in when you print. So this actually works under windows:
    #!/usr/bin/perl -p BEGIN {binmode STDOUT}
    and this will work under unix:
    #!/usr/bin/perl -p tr/\r//d;
    Or if you just want one script for both, you can combine the two. Or you can use sysread and syswrite to be more efficient :)
Re: reap fodder
by etcshadow (Priest) on Jun 04, 2004 at 20:07 UTC
    perl -pi -e 's/\r\n/\n/' file.txt
    ------------ :Wq Not an editor command: Wq
Re: reap fodder
by TomDLux (Vicar) on Jun 04, 2004 at 19:13 UTC

    Congratulations on your coding efforts, however dos2unix is a standard component of most Unix systems, and might also be included in Cygwin.

    --
    TTTATCGGTCGTTATATAGATGTTTGCA

A reply falls below the community's threshold of quality. You may see it by logging in.