Click here to get back home

Perl and sendmail alias/forward file

 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 and sendmail alias/forward file sverne 03-06-2006
Get Chitika Premium
Posted by sverne on March 6, 2006, 5:31 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 Andrzej Adam Filip on March 6, 2006, 5:48 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
Trying to get sendmail to attach text file to email. November 14, 2004, 2:27 am
Script to send file attachment with sendmail not working November 20, 2004, 7:53 pm
Unable to lock a file to stop sendmail writing to it July 20, 2006, 4:54 am
Perl and Sendmail May 9, 2006, 10:49 am
sendmail Help Please July 31, 2005, 3:13 pm
sendmail September 28, 2005, 4:35 pm
CGI/sendmail help January 2, 2006, 8:01 am
Sendmail April 10, 2008, 1:20 am
Help! Sendmail on Mac OS X Server October 12, 2004, 3:53 pm
Mail::Sendmail August 31, 2005, 12:33 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap