Click here to get back home

Logging UDP Packets

 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
Logging UDP Packets Matt 11-05-2004
Posted by Matt on November 5, 2004, 3:35 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 Joe Smith on November 7, 2004, 11:39 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
sending icmp packets with raw::ip April 27, 2005, 6:53 pm
Tracking the RTP Packets Send. May 18, 2007, 7:36 am
Simulating smaller MTU? ie sending small packets. August 16, 2005, 10:44 pm
Logging onto a Website August 27, 2007, 12:03 am
Perl LWP, logging into yahoo etc ? October 6, 2005, 12:19 pm
Logging Errors (Instead of Just Dying) November 26, 2005, 4:35 pm
[Net::Jabber] problem with logging May 15, 2006, 9:39 am
CGI file based logging March 4, 2008, 10:59 pm
Logging with Log::StdLog from within a package July 31, 2008, 1:35 am
Logging into and parsing a website using Perl February 15, 2005, 10:11 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap