Click here to get back home

Perl + Objects = Winning combination

 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 + Objects = Winning combination Mumia W. 04-09-2007
Get Chitika Premium
Posted by Mumia W. on April 9, 2007, 7:55 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 Robert Hicks on April 9, 2007, 9:52 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
How To Pick Winning Stocks June 14, 2006, 11:41 pm
Accessing a container objects state from aggregated objects August 14, 2006, 8:50 pm
Looking for combination.pm June 29, 2005, 10:56 pm
every combination of Y/N in 5 positions March 31, 2008, 4:57 pm
htaccess rewriterule in combination with POST form January 28, 2005, 12:38 am
Objects/Structures in Perl July 26, 2007, 5:00 pm
Using "Perl Best Practices" inside-out objects May 15, 2007, 3:17 pm
Perl Standard for Remote Objects. June 28, 2007, 8:14 am
Exange of informations and objects between PERL and JAVA August 23, 2004, 4:48 am
[perl-python] 20050124 classes & objects January 24, 2005, 7:54 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap