Click here to get back home

Why perl -n0e doesn't work on cygwin and NT

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Why perl -n0e doesn't work on cygwin and NT Todd 12-06-2007
Get Chitika Premium
Posted by Todd on December 6, 2007, 3:57 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
Why $1 not work in cygwin? July 10, 2005, 11:57 pm
Known issues with Perl under Cygwin? August 26, 2005, 6:43 pm
How to set the baud rate on a serial port (Perl under cygwin)? January 5, 2005, 12:42 pm
No execution of system calls in cygwin-perl after update August 24, 2006, 4:22 pm
several problems with cygwin perl, Activeperl, perlmagick and Apache (Windows) December 21, 2005, 3:08 am
What is "$^O" on Cygwin? September 18, 2005, 12:26 am
Bit-Vector-6.4 on Cygwin December 19, 2005, 4:25 am
Confusion of Win32::ODBC under CygWin. Please help... August 22, 2004, 5:03 am
installing dbd::mysql via cygwin on windows December 4, 2004, 1:31 am
Re: Cygwin error regarding profile.global September 4, 2006, 6:16 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap