Click here to get back home

Open3 with nonblocking reads

 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
Open3 with nonblocking reads R.Schuller 09-03-2004
Posted by R.Schuller on September 3, 2004, 7:51 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
IO::Pty - reads/writes fail *only* with system() January 6, 2006, 5:01 pm
Multithreaded and/or nonblocking server? February 16, 2006, 6:51 pm
Reading from stdin then launching a program that reads from stdin strange behaviour July 27, 2007, 6:50 am
How to read file in nonblocking mode? December 7, 2006, 3:18 am
IPC::Open3 August 24, 2005, 2:23 pm
IPC::Open3 November 11, 2006, 8:10 pm
How do you use IPC::Open3.... January 19, 2008, 5:11 pm
open3 and signals September 20, 2004, 8:43 pm
IPC::Open3 issue August 24, 2005, 3:21 pm
can't get STDERR using open3... December 20, 2006, 3:21 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap