Just another Perl shrine | |
PerlMonks |
Re: $functions xor $methodsby adrianh (Chancellor) |
on Oct 30, 2002 at 11:08 UTC ( [id://209028]=note: print w/replies, xml ) | Need Help?? |
Surely the obvious "solution" is to just call the function as a function?
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:
In Section
Meditations
|
|