Click here to get back home

using a package

 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
using a package Nospam 02-04-2006
Get Chitika Premium
Posted by Nospam on February 4, 2006, 4:37 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 Anno Siegel on February 5, 2006, 5:28 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
Using a package that might not be available January 6, 2006, 8:55 pm
How to use OO and package? August 7, 2006, 4:55 am
FAQ: How do I clear a package? October 19, 2004, 11:10 pm
sub in a package with parameters May 12, 2005, 11:07 am
FAQ 7.27: How do I clear a package? November 15, 2004, 12:03 am
FAQ 7.27: How do I clear a package? December 9, 2004, 6:03 pm
Current package name January 8, 2005, 6:57 pm
Net::Nessus Package February 9, 2005, 4:04 am
FAQ 7.27 How do I clear a package? March 5, 2005, 6:03 pm
Help with Mysql package March 26, 2005, 3:10 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap