Ok, repeat after me ...
"Global variables are bad"
"Global variables are bad"
"Global variables are bad"
"Read Code Complete by Steve McConnell"
As you can see I try to avoid global variables at all cost. If the number of variables your are passing to modules/functions is over 10. You need to take a look at what you're doing again and rethink it. Try to combine variables that are related and pass them as a hash.
Look at
CGI::Application as a large framework for web applications. If its a stand alone program you can still get an idea as to how you can organize things.
You're not too clear as to what you're doing. But in any application if you're passing too many variables in to give it information, you're more likely to have problems. Both in tracking down where it is and how many crop up as well as how much time it takes to create it. Try to break the task down as much as you can. You'll find you can reuse code in a lot of places and save a lot of time.
The more you reduce the load on the database, the better your application will run. Though having 30 or more variables going to a module won't slow the application down, it just makes it more complicated. Just remember you have to keep track of all those variables.
Work on getting the job done first, then optimise it for speed.
BMaximus
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.