quick update: I just re-read your question and realized that you're not looking for run-time catching; you want something earlier. So my post doesn't answer your question. However, you still might find it an interesting way to deal with the run-time problem.
We have a universal AUTOLOAD function in our app which catches these errors and prints a nice message. I'm at home, so I don't have the code in front of me, but I remember that I got the idea from the perl cookbook. I just found the table of contents on O'Reilly's site: it looks like chapter 10.15 is what I'm thinking of.
We've had our AUTOLOAD for several years, and it does a few nice things besides catching our sloppy mistakes. However, it has a lot of disadvantages, like killing inheritance (which never used to bother us because none of our code was OO), and encouraging sloppy programming, so it's a mixed blessing.
-Joe
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.