Click here to get back home

Formatting XML output from a hashref

 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
Formatting XML output from a hashref Sam 08-23-2005
Get Chitika Premium
Posted by Sam on August 23, 2005, 2:43 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
newbie question on output formatting/"pretty" print April 16, 2006, 10:59 pm
DBI hashref to CGI optgroup? September 21, 2006, 11:30 am
Equality of hashref objects February 4, 2005, 6:32 pm
iterating over a hashref of hashrefs June 7, 2005, 3:21 pm
Syntax for a slice of a hashref November 15, 2007, 4:58 pm
hashref strange side effects December 23, 2004, 12:24 pm
Combining statements - a hashref from a hash slice May 11, 2006, 8:49 pm
Silencing TODO output from Test::Harness output October 17, 2006, 1:07 am
pod and formatting? January 18, 2005, 8:49 pm
About formatting April 30, 2005, 7:20 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap