Click here to get back home

How to determine memory usage?

 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
How to determine memory usage? kj 01-21-2006
Get Chitika Premium
Posted by kj on January 21, 2006, 7:03 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 xhoster on January 21, 2006, 11:16 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
Memory usage January 31, 2006, 6:39 pm
How to get program's memory usage? February 22, 2005, 7:10 pm
get mod_perl max memory usage April 11, 2005, 12:58 pm
Taint and memory usage September 13, 2006, 5:00 pm
How to detect memory usage in hash? October 26, 2005, 11:23 am
memory/cpu usage by process in win2000/XP December 10, 2005, 1:20 am
get memory percent usage info August 31, 2007, 2:09 pm
Problem with memory usage in pattern match December 5, 2005, 9:33 am
best practice to avoiding excessive memory usage?? November 17, 2006, 9:38 am
Determine read/write status of filehandles connected to memory objects. March 15, 2006, 11:40 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap