Best practice logging is simply to use
Log::Dispatch::Config. It will take care of all your logging needs, and just quite simply be the right way to do logging. Trust me on this one.
Best practice error handling is to use exceptions. Otherwise you end up passing return codes back up the stack, and with 30 or 40 classes that's going to get messy. Try using exceptions by throwing objects - good modules to use for this are Exception::Class and Error (though beware of the try/catch syntax offered by the latter - it's tempting but uses closures so can lead to memory leaks if you don't know what you're doing). Also I recommend a $SIG{__DIE__} handler for catching non-object exceptions (i.e. when someone just does "die 'Foo'" in their module), this way all your exceptions can provide useful backtrace information.
And yes, I have a talk on this for the upcoming Perl Conference. ;-)
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.