Click here to get back home

Module for getting values from "flattened" hash or "recursed" hash...?

 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
Module for getting values from "flattened" hash or "recursed" hash...? newsbot 03-08-2005
Get Chitika Premium
Posted by newsbot on March 8, 2005, 7:05 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 Fabian Pilkowski on March 9, 2005, 6:36 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
copying values from a hash into CGI.pm via tied hash reference December 27, 2004, 7:02 am
Adding values to anon hash of hash while looping... September 2, 2005, 7:42 am
accessing hash values with %hash-> ? May 31, 2006, 11:27 am
values of hash of hash September 1, 2005, 11:27 am
hash values May 9, 2006, 11:33 am
[FR-EN] Pb de hachage dans un module (.pm) / make a hash in a module (.pm) September 1, 2005, 1:59 am
how to evaluate values in a hash April 20, 2005, 2:22 pm
Sorting on sub-hash values June 23, 2005, 11:30 am
Get values from hash "in order" December 12, 2007, 12:37 pm
Uninitialized values in hash April 10, 2008, 2:54 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap