Click here to get back home

HTML::PARSER issue

 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
HTML::PARSER issue MoshiachNow 12-12-2006
Get Chitika Premium
Posted by MoshiachNow on December 12, 2006, 9:50 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

Posted by Paul Lalli on December 12, 2006, 10:37 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
Hash references & parsing HTML with HTML::Parser February 16, 2005, 8:10 pm
HTML Parser December 16, 2004, 5:50 pm
HTML/DOM parser February 28, 2006, 3:35 am
HTML::Parser and

behaviour?

October 13, 2004, 7:49 pm
HTML/Parser.pm missing? September 17, 2005, 12:56 pm
HTML::Parser - duplicated text in

..

?
March 9, 2005, 11:44 am
HTML:Parser how to remove "//" ? January 31, 2007, 6:01 am
need help reading source code: HTML::Parser December 31, 2004, 9:41 am
HTML::Parser 3.49 won't compile (SuSE 8.0/Perl 5.8.7)? February 11, 2006, 4:27 pm
Regex...HTML::Parser...Getting webpage data? August 3, 2006, 2:31 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap