Click here to get back home

Perl Forum

 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 Forum Throne Software 07-09-2005
`--> Re: Perl Forum A. Sinan Unur07-10-2005
Get Chitika Premium
Posted by Throne Software on July 9, 2005, 9:06 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 A. Sinan Unur on July 10, 2005, 4: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
forum perl January 22, 2007, 11:55 pm
most active perl discussion forum May 28, 2007, 9:49 pm
Discussion forum sofware in perl August 11, 2008, 6:52 am
Online forum source codes in Perl/CGI without SQL? October 23, 2004, 12:00 am
could I use perl to write a script to logon multiple web forum? August 18, 2004, 4:10 pm
Setting up YaBB Perl forum - weird respond as plain text in browser, including headers May 17, 2007, 6:13 pm
forum October 2, 2005, 9:56 am
Need forum Administrator October 18, 2005, 10:38 am
Which is the best FREE forum? April 14, 2007, 1:37 am
Forum Script November 2, 2007, 6:15 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap