Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thus, Parent::identify should return the string 'Parent'. How do I create a second class, 'Child', so that Child::identify returns the value returned by name() in the Child package?package Parent; sub identify { return name(); } sub name { return 'Parent'; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Overriding 'static' methods of a perl package
by Fletch (Bishop) on Sep 16, 2008 at 13:52 UTC | |
|
Re: Overriding 'static' methods of a perl package
by Corion (Patriarch) on Sep 16, 2008 at 13:53 UTC | |
by Anonymous Monk on Sep 16, 2008 at 14:46 UTC | |
by Corion (Patriarch) on Sep 16, 2008 at 14:48 UTC | |
by Anonymous Monk on Sep 16, 2008 at 15:18 UTC | |
by Corion (Patriarch) on Sep 16, 2008 at 15:37 UTC | |
|