Click here to get back home

variable evaluation and printing

 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
variable evaluation and printing manunderstress 03-21-2007
Get Chitika Premium
Posted by Brian McCauley on March 22, 2007, 2: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

Similar ThreadsPosted
Modifying and printing a string variable September 12, 2006, 2:31 am
Lazy evaluation? February 13, 2007, 9:14 pm
order of evaluation March 26, 2007, 6:41 am
$@ Evaluation Error Oddity July 8, 2004, 8:07 pm
SWITCH: question on evaluation November 10, 2004, 12:42 pm
Hashes, flattening, evaluation March 16, 2005, 11:36 pm
Unintuitive expression evaluation October 27, 2005, 8:30 pm
Arithmetic Expression Evaluation in print November 22, 2005, 12:31 am
Evaluation context of C-style Logical And/Or January 14, 2007, 8:45 pm
Perl - delayed evaluation of variables? April 17, 2008, 6:56 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap