Click here to get back home

IPC::Open3 issue

 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
IPC::Open3 issue Rocky Allen 08-24-2005
Posted by Rocky Allen on August 24, 2005, 3:21 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

Posted by Joe Smith on August 24, 2005, 10:13 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
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
can't get STDERR using open3... December 20, 2006, 3:21 pm
IPC::open3: What goes wrong? August 1, 2007, 1:05 pm
Example for open3 on windows? May 20, 2008, 1:33 am
Open3 with nonblocking reads September 3, 2004, 7:51 am
IPC::Open3 and the error filehandle October 26, 2007, 9:33 am
Scary IPC::Open3 filehandle difference October 28, 2004, 1:23 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap