as far as I know base does not (in general/reliably) call import(). While a
use SomeClass; will always call
SomeClass->import() which is then resolved using the regular inheritance mechanism (which is how
Exporter works, for example) i.e. - if SomeClass::import is there, it call that, otherwise it works itself up the inheritance (@ISA) tree for SomeClass.
update: note that if you need your code in SomeClass to run only once per process (instead of once per use) you can just put that code outside of any subroutine in SomeClass.pm and it will get run the first time that module is require()d or use()d.
See also use and require.
update 2 there is no modeling reason any of your modules should inherit from the configuration at all. I would go as far as to say that that would be a badly implemented model. (though you could make the case that it should inherit from a base that has access to the configuration). See also my reply to Sharing data between children modules.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.