Click here to get back home

perl warnings

 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 warnings Daniel Molina Wegener 10-10-2004
Get Chitika Premium
Posted by Daniel Molina Wegener on October 10, 2004, 8:36 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 Sherm Pendley on October 10, 2004, 8:05 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
use warnings; and use Warnings; give different results August 30, 2004, 2:09 pm
checklink - perl warnings October 7, 2004, 6:37 am
Using strict and warnings in embedded perl July 14, 2004, 4:11 am
warnings in Visual studio when using swig for perl on c++ December 14, 2005, 3:10 am
warnings or -w ? November 5, 2006, 7:24 am
Why aren't 'warnings' on by default? February 5, 2005, 2:19 am
Where are the warnings "keywords"? March 13, 2005, 3:00 pm
Can't locate warnings.pm in @INC October 10, 2005, 10:37 am
Warnings in program December 7, 2005, 7:54 am
warnings dilemma May 10, 2007, 12:28 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap