Click here to get back home

writing to a pipe on win32

 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
writing to a pipe on win32 momena 07-26-2004
Get Chitika Premium
Posted by momena on July 26, 2004, 12:42 pm
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
How to open a pipe for reading and writing? November 5, 2004, 5:16 pm
reading from pipe, writing to a file June 1, 2006, 12:35 am
reading from pipe, writing to a file June 1, 2006, 12:35 am
WIN32::PIPE bug ? June 13, 2006, 11:25 pm
pipe-open on win32 May 31, 2005, 10:07 am
Dave Roth's site (Win32::AdminMisc, Win32::ODBC, etc.) not available. December 22, 2005, 7:38 am
use Win32::TieRegistry if ($^O =~ /win32/i) June 1, 2006, 12:58 pm
SIG October 3, 2007, 9:41 pm
children not getting eof from pipe June 19, 2005, 9:40 pm
Zero equals pipe?? September 23, 2006, 9:17 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap