Click here to get back home

open3 and signals

 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 and signals Mike 09-20-2004
Posted by Mike on September 20, 2004, 8:43 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 Mike on September 24, 2004, 7:19 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
traping signals April 26, 2005, 7:55 am
IPC::Open3 issue August 24, 2005, 3:21 pm
can't get STDERR using open3... December 20, 2006, 3:21 pm
Mod_perl and Signals May 17, 2007, 5:17 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

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap