Click here to get back home

Perl got sth. from Python, but what?

 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 got sth. from Python, but what? Mirco Wahab 05-20-2006
Get Chitika Premium
Posted by Mirco Wahab on May 20, 2006, 7:21 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
[perl-python] Python documentation moronicities (continued) April 12, 2005, 4:25 am
a new Perl/Python a day January 9, 2005, 5:04 pm
Perl vs. Python February 10, 2006, 3:58 am
python for perl programmers? October 14, 2004, 9:26 pm
Perl Versus Python February 6, 2005, 6:18 am
[perl-python] combinatorics fun February 10, 2005, 3:51 pm
Perl-Python-a-Day: Sorting October 10, 2005, 2:51 am
Perl vs Python vs Ruby October 18, 2005, 6:56 am
python feature in perl? November 6, 2008, 10:08 pm
[perl-python] Range function May 12, 2005, 8:32 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap