Click here to get back home

Perl Network programming

 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
Perl Network programming Kuldeep 05-13-2006
Get Chitika Premium
Posted by Kuldeep on May 13, 2006, 3:16 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 Bernhard Brueck on May 13, 2006, 9:04 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
Broken Pipe in Network Programming June 14, 2006, 11:50 pm
Is there any module to map a network drive and remove a mapped network drive in perl October 22, 2007, 8:11 am
Perl Extreme Programming download now | http://freepdf-ebook.blogspot.com/2007/12/extreme-perl-programming.html December 25, 2007, 3:28 pm
perl network sniffer February 25, 2005, 8:48 am
How can I prevent perl from exiting during a network error? May 8, 2005, 9:32 am
windows based network instant messenger in perl July 24, 2004, 8:59 pm
Network Monitoring app. August 21, 2004, 8:09 pm
Network Scanner September 6, 2004, 9:58 pm
Network issue September 27, 2004, 2:09 pm
network simulator - NS2 January 5, 2007, 1:14 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap