Click here to get back home

DCFORUM won't execute file as script

 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
DCFORUM won't execute file as script blubberpuss 07-26-2005
Posted by blubberpuss on July 26, 2005, 8:10 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 Paul Lalli on July 26, 2005, 9:50 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
how to execute external file in script May 1, 2007, 8:58 pm
newbie question: can't get script to execute October 15, 2005, 8:46 am
Firefox Won't Execute My Perl Script October 9, 2006, 9:07 pm
Firefox Won't Execute My Perl Script October 9, 2006, 9:07 pm
execute current PL script in kdevelop on FC5/KDE May 14, 2007, 4:05 pm
How to execute tar inside a perl script ? December 10, 2007, 7:59 am
Execute Windows program from Perl script (??) August 27, 2004, 2:48 pm
Faster way to execute contents of a perl script? March 10, 2005, 12:58 pm
CGI: Execute a perl script inside another perl script January 12, 2005, 6:35 am
Execute another perl script from my perl script January 5, 2005, 2:18 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap