Click here to get back home

Hash value not being interpolated

 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
Hash value not being interpolated evillen@innocent.com 02-03-2005
Get Chitika Premium
Posted by evillen@innocent.com on February 4, 2005, 5:38 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
Variables interpolated in character classes? March 16, 2008, 1:08 am
suppress regex parsing in interpolated string February 28, 2006, 2:08 pm
Perl hash and rehash seeds; deterministic hash ordering January 19, 2007, 5:01 pm
copying values from a hash into CGI.pm via tied hash reference December 27, 2004, 7:02 am
Module for getting values from "flattened" hash or "recursed" hash...? March 8, 2005, 7:05 pm
Combining multiple hash references into one hash reference September 1, 2005, 1:47 pm
Adding values to anon hash of hash while looping... September 2, 2005, 7:42 am
Sort by hash vaule, an array of hash references October 6, 2005, 12:52 pm
Searching an example for a defined hash value of a nonexisting hash key July 20, 2004, 5:47 pm
Perh Hash of Hash of Array structure March 29, 2007, 2:52 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap