Click here to get back home

Sending a "status"

 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
Sending a "status" Bill H 08-17-2007
|--> Re: Sending a "status" Christian Winte...08-17-2007
Get Chitika Premium
Posted by Petr Vileta on August 18, 2007, 10: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

Posted by Martijn Lievaart on August 19, 2007, 2: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
How can I get the exit status? February 18, 2005, 8:15 am
Apache::Status March 3, 2005, 1:14 pm
exit status March 31, 2006, 10:37 am
CGI::Carp die with status February 5, 2008, 10:44 am
Net::Telnet connection status November 8, 2004, 6:50 am
how to check the status of a process, by ID February 12, 2005, 11:04 pm
Checking thread status August 4, 2005, 7:51 pm
query status of STDIN November 20, 2005, 6:13 pm
exit status problem. May 18, 2006, 9:14 am
Exit status from perl script May 3, 2005, 11: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