Click here to get back home

Makefile - perl script syntax error

 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
Makefile - perl script syntax error NewBie 08-24-2005
Posted by NewBie on August 24, 2005, 5:58 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 Josef Moellers on August 24, 2005, 12:54 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
makefile syntax to exclude files February 21, 2006, 9:23 am
Syntax error? What syntax error? Assignment fo default values? November 18, 2007, 11:36 am
Re: 533: error: syntax error before "void" March 24, 2006, 4:58 pm
why no syntax error? November 30, 2004, 3:05 am
Syntax Error? February 9, 2007, 8:21 am
combine perl and makefile April 21, 2006, 8:10 am
dbmopen syntax error January 3, 2006, 5:43 pm
Line gives syntax error January 5, 2006, 5:26 pm
Can't find syntax error June 12, 2006, 11:18 am
Strange syntax error July 11, 2006, 2:07 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap