From: Mike S. <m...@pe...> - 2004-08-24 00:46:13
|
Lee Carmichael wrote on 8/23/2004, 3:37 PM: > I have run across a slight problem or a request for a > new feature with the Log::Log4perl::Appender::File.pm > module. I asked for a filename method to access the > 'filename' attribute but now I want to override the > 'filename' attribute in a child module (what is the > correct OO term for something down the tree in > inheritence...?) I typically use the term "derived class". > The problem is that the 'file_open' > method/sub uses the attribute not the method so if I > override 'filename' method it doesn't get used by the > 'file_open'. I have patched (and included) diff for > the 'File.pm' to use the method instead of the > attribute. I could have override the 'file_open' > method but that is more than the three lines to > override the 'filename' method... Yes I am very lazy. > ;) Can you provide more details on what the derived class will be provide differently than the base class? If you're overriding filename(), you probably also have to override the constructor, which doesn't leave much base class functionality left. -- -- Mike Mike Schilli m...@pe... |