Click here to get back home

Perl grabbing an external image

 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
Perl grabbing an external image kjhjhjhjadsasda 12-15-2005
Get Chitika Premium
Posted by Brian Wakem on December 16, 2005, 11:23 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
Saving an image from external site January 29, 2005, 7:05 pm
Grabbing GPS data using perl March 7, 2008, 4:48 pm
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
Grabbing a PDF file from the web...how? November 8, 2004, 3:40 pm
Need a module for grabbing text from a web page February 18, 2005, 11:42 pm
Grabbing multiple variables based on name, with regexp? February 20, 2006, 7:57 pm
Trouble with parsing text file and grabbing values needed July 21, 2006, 1:18 pm
UTF-8 without external modules on Perl 5.0 May 19, 2006, 8:32 am
include external perl program March 8, 2005, 10:06 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap