No, I wouldn't put it in an import module. A BEGIN block would be better. If you put it in import, you have no guarantee that the import method will ever actually be called. It's quite easy to load a module without ever calling the import method. Conversely, it's very easy for the import method to get called multiple times.
I actually do something pretty similar to the technique being discussed in XML::LibXML::Augment.
In reply to Re^5: perl inheritance
by tobyink
in thread perl inheritance
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |