Click here to get back home

posting image data (not url) from HTML to Perlscript

 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
posting image data (not url) from HTML to Perlscript Eadmund 06-06-2006
Get Chitika Premium
Posted by Eadmund on June 6, 2006, 12:33 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 Bart Van der Donck on June 6, 2006, 12:55 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
how to simply parse raw image data and output to an image file ? January 3, 2008, 11:19 am
best way to store binary image data in a variable using image magick January 25, 2008, 1:17 am
Image data parsing October 27, 2004, 3:36 pm
Printing Data usinf Perl to an HTML does not work with large amount of data December 6, 2004, 11:36 pm
Posting UTF-8 form data with WWW::Mechanize and LWP May 11, 2005, 7:12 pm
Module Suggestions for Posting Form Data April 4, 2006, 8:23 pm
send data to html form August 4, 2005, 7:06 am
Regex...HTML::Parser...Getting webpage data? August 3, 2006, 2:31 pm
adding a data field to a subclass of HTML::Parser March 12, 2007, 3:06 pm
getting data from database (sybase) in an html table on a webpage June 12, 2007, 5:53 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap