Click here to get back home

Follow-up:go to a link, save the page and email it out?

 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
Follow-up:go to a link, save the page and email it out? dale 12-15-2004
Posted by dale on December 15, 2004, 8:30 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 Anno Siegel on December 16, 2004, 1: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
go to a link, save the page and email it out? December 14, 2004, 10:49 am
How to go to a link and save a page and email it out? December 15, 2004, 9:18 am
Search.cgi followup November 21, 2004, 10:02 pm
How to extract all link from web page (loaded in variable $content) to scalar @links? September 11, 2006, 4:47 am
A Web Development QUICK LINK PAGE (QLP) - HTML, Perl, PHP, JavaScript, AJAX, CGI, etc. May 1, 2007, 8:02 pm
which email module - MIME::LITE, Email::Send, other? January 4, 2007, 5:52 pm
LWP user agent grabs the intermediate wait page after POST intead of the actual result page February 12, 2008, 12:50 am
transfer value from one page to single frame of a second,frameset page September 14, 2008, 7:25 am
LWP Doesn't Seem To Save Cookies: March 23, 2005, 2:14 am
Save your world November 25, 2005, 8:21 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap