Click here to get back home

multiple languages

 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
multiple languages paul 11-03-2006
Posted by paul on November 3, 2006, 11: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 Mark Clements on November 4, 2006, 5:59 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
Sanitizing user inputs in multiple languages April 4, 2007, 9:01 pm
braindead languages? November 9, 2004, 5:27 pm
Lightweight Languages 2004 (LL4) CFP October 11, 2004, 5:59 am
Perl and Theory of languages July 23, 2006, 4:51 am
Perl examples in many other languages January 5, 2007, 2:58 am
Languages that don't suck after Perl? July 21, 2008, 2:24 am
references/addrresses in imperative languages June 19, 2005, 4:34 pm
Re: languages with full unicode support July 4, 2006, 12:05 pm
Perl's reference is the best compare with other languages December 31, 2006, 11:14 pm
Parallel search in Perl and other languages July 28, 2008, 9:00 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap