Click here to get back home

Scary IPC::Open3 filehandle difference

 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
Scary IPC::Open3 filehandle difference Mike Hunter 10-28-2004
Get Chitika Premium
Posted by Mike Hunter on October 28, 2004, 1:23 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

Posted by Ilmari Karonen on December 14, 2004, 11:54 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
IPC::Open3 and the error filehandle October 26, 2007, 9:33 am
'nobody' using sudo -- scary! June 26, 2008, 10:47 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
IPC::open3: What goes wrong? August 1, 2007, 1:05 pm
Example for open3 on windows? May 20, 2008, 1:33 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap