October 20, 2003

Compile-time implementation enforcement... in Perl

Class::Virtual - This is old news (first released almost three years ago) but it’s new to me. (Or I learned it at one time and erased all traces from my noodle.)

The distribution actually comes with two classes. The eponymous one does runtime checking -- it provides for a report on what methods the abstract base class wants subclasses to implement and a nicer error message. The other, Class::Virtually::Abstract provides for compile-time checking, which is the real carrot here. The only caveat is that you need to use the module instead of require it (or eval "require" it). Extremely useful for framework and other library authors.

Next: Potential TWiki security hole
Previous: At least you don't work for these people