Click here to get back home

Tricky subclassing problem: Parent class method uses static value from child class

 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
Tricky subclassing problem: Parent class method uses static value from child class don.hosek 09-26-2006
Get Chitika Premium
Posted by don.hosek on September 26, 2006, 4:45 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

Posted by Mumia W. (reading news) on September 26, 2006, 6:37 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
Overriding a class method with an object method July 2, 2007, 4:33 pm
[Long] Static classes, inheritance and base class funkery - or overriding module subroutines May 31, 2007, 5:58 pm
How to get the class & method name September 25, 2008, 4:58 pm
perl fork() problem: child exit() kills parent November 25, 2005, 5:34 pm
Perl parent-child communication. April 24, 2007, 4:42 am
Ensuring parent/child processes September 6, 2007, 12:14 pm
Killing all child processes upon parent exit November 30, 2005, 8:58 pm
(?{ code }) block works fine in child rule but not in parent September 10, 2007, 2:02 pm
Class quandry July 23, 2004, 3:45 am
Using an Array in a Class October 5, 2004, 12:52 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap