Click here to get back home

file attachment not working properly.

 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
file attachment not working properly. Mortgageloan2004 11-14-2004
Posted by Mortgageloan2004 on November 14, 2004, 5:01 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 Lars Eighner on November 14, 2004, 12:56 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
Script to send file attachment with sendmail not working November 20, 2004, 7:53 pm
GIFS not working properly in JavaScript PopUps June 10, 2006, 2:34 am
parallel child processes not working properly June 11, 2007, 12:09 am
LWP File Attachment question June 30, 2005, 11:47 pm
saving file attachment from mbox ? January 31, 2005, 12:44 pm
Problrms with decoding pdf file when iy goes as an attachment February 16, 2006, 1:42 pm
Email with text file attachment November 30, 2007, 7:18 pm
Cgi/Perl script for multiple file upload/attachment in web form November 4, 2004, 2:15 pm
Working with a 1-GB XML file... January 17, 2008, 12:40 pm
File::SortedSeek not working January 24, 2008, 12:12 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap