Click here to get back home

HTML::TokeParser; __DATA__ as a filehandle

 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::TokeParser; __DATA__ as a filehandle Jonathan 10-24-2006
Get Chitika Premium
Posted by Jonathan on October 24, 2006, 2:07 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
Return HTML between tags with HTML::TokeParser ? February 22, 2005, 5:44 pm
HTML::TokeParser October 16, 2005, 5:07 pm
HTML::TokeParser January 29, 2007, 5:30 am
HTML::TokeParser & TableExtract April 25, 2006, 12:05 pm
HTML::TokeParser and Matching November 28, 2006, 4:42 pm
Parsing javascript with html::tokeparser December 29, 2005, 11:18 pm
HTML::TokeParser::Simple : is't suitable for me ?? October 7, 2005, 12:28 am
Printing Data usinf Perl to an HTML does not work with large amount of data December 6, 2004, 11:36 pm
Using process as filehandle causes change in behaviour of April 7, 2006, 11:16 am
use print to write binary data to a filehandle seems not correct November 21, 2006, 9:47 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap