Check out
Re: Re (tilly) 1: Stopgap measures when you don't have a QA department, it demonstrates a little registration sub for packages that uses
caller instead of passing the package name. I've used this strategy sucessfully in the past. Just be careful if you are using mod_perl and STAT_INC, when the GateKeeper (central registration point) module reloads, it will forget all the packages that have registered up to that point.
Now for the fun part, you can have multiple stragegies for figuring out which modules to load. You could have a basic static list, a run-time user interface, and do a foreach on a readdir, requiring all modules in the puglins/ directory.
This is a great base for a Factory class or a list of arbitrary handlers.
-jackdied
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.