Click here to get back home

problem in POSIX module with handling SIGCHLD

 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
problem in POSIX module with handling SIGCHLD msoulier 07-15-2005
Get Chitika Premium
Posted by msoulier on July 15, 2005, 8:52 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 July 16, 2005, 2:11 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
POSIX signal handling: inputs needed November 21, 2007, 9:35 pm
sleep/fork/shell/SIGCHLD interaction problem November 11, 2007, 10:41 am
POSIX::mktime problem on linux. May 24, 2006, 5:15 am
Problem with File Handling? March 20, 2006, 6:23 am
ignoring SIGCHLD June 23, 2005, 10:23 am
Problem handling a Unicode file August 28, 2006, 2:34 am
SIGCHLD not called under Windows October 27, 2006, 8:13 pm
Newbie with simple File handling problem November 14, 2006, 12:52 pm
What is ISDST in POSIX::MKTIME? July 16, 2004, 7:53 am
Force POSIX NFA in Perl? July 14, 2005, 11:46 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap