What I didn't think was worthwhile is worrying about which
low-level operation you can get away with which times. Instead analyze your code for steps that may or may not ever be needed, and only include the ones that you are using this time.
This results in a structure with a lot of single level if statements, which avoids the explosion of possible combinations. Flexibility without undue code complication and without paying run-time performance except for the steps you need.
As for what CGI does, the trick is that if you have a function in a package named AUTOLOAD, then it will be called on any unknown functions or method calls. $AUTOLOAD is the name of the unknown method. So what happens is that he creates a hash of possible methods he may or may not ever need, and an AUTOLOAD function. Upon your first trying to call a function or method he creates it on the fly and runs it. Upon your second try the method is already there, and is called directly. If you need all of the methods this is slower than just compiling directly. If you only need a few then this is faster.
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.