Click here to get back home

Cron Job & Perl

 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
Cron Job & Perl goooo 03-21-2005
Get Chitika Premium
Posted by goooo on March 21, 2005, 12:38 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 Joe Smith on March 22, 2005, 4:47 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
Cron Job through Perl June 26, 2006, 1:39 pm
Ftp via Perl cron job September 26, 2006, 11:44 am
cron manipulation using perl September 17, 2004, 11:17 am
Perl/Cron Conflict May 9, 2005, 3:46 pm
start some actions with Perl without Cron? August 21, 2004, 1:33 am
Runs Fine In Perl :: Not As Cron Job January 15, 2007, 1:19 pm
shutdown of linux box from cron perl script January 7, 2005, 12:58 am
Re: shutdown of linux box from cron perl script January 7, 2005, 1:02 am
problem starting perl script from cron environment - ps: don't know which terminal to select March 19, 2008, 8:24 am
Using Schedule::Cron October 17, 2006, 1:03 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap