Click here to get back home

small mistake: http://perl.plover.com/FAQs/Namespaces.html

 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
small mistake: http://perl.plover.com/FAQs/Namespaces.html szr 07-03-2007
Get Chitika Premium
Posted by szr on July 3, 2007, 5:27 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 Michele Dondi on July 3, 2007, 6:33 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 szr on July 3, 2007, 7:58 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
Free perl ebook | http://freepdf-ebook.blogspot.com/2007/12/tech-perl-programming-in-21-days.html December 14, 2007, 3:58 pm
Free perl reference ebook Download now | http://freepdf-ebook.blogspot.com/2007/12/tech-perl-programming-in-21-days.html December 11, 2007, 4:54 pm
How to call a simple perl script from HTML without need of HTTPS but simple HTTP ? May 11, 2006, 4:37 am
Weird HTTP heders in Html Body March 17, 2005, 2:17 pm
Perl Extreme Programming download now | http://freepdf-ebook.blogspot.com/2007/12/extreme-perl-programming.html December 25, 2007, 3:28 pm
HTTP Proxy via HTTP Layer by Perl? October 19, 2004, 5:56 pm
mistake in my for January 20, 2006, 3:30 pm
.htaccess mistake December 5, 2007, 2:59 pm
A small Perl problem November 5, 2004, 1:52 pm
Small doubt in perl September 27, 2007, 1:55 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap