in reply to $functions xor $methods
Surely the obvious "solution" is to just call the function as a function?
package Bar; @Bar::ISA = 'Foo'; sub foobared { my $self = shift; $self->{foo} = Foo::_test( 3 ); }
No code duplication. Works as expected. Functions are called as functions. Methods as methods.
I sometimes use functions in this way - exactly because they are not inherited. It means you can encapsulate some of your class implemention details in subs and not have to worry about some sub-class overriding them and breaking the public interface.
Not having looked at the code, I'm not sure if this applies to Data::FormValidator, but from your example it looks like you're trying to override an implementation detail (that leading "_" is a bit of a give away) in which case you're asking for trouble :-)
Corrections:
|
|---|