A slight aside here. I try to use global vars sparingly. At my work I notice the most common use of them is to define site specific info (paths to filenames, database names etc.) For those kind of thing that do
not change during the running of a script, I perfer to use
constant. For me I've found that it makes the purpose of the statement a little clearer as well as not having to be concerend with scope for those things.
Also I perfer not to use global varibles in several files. When i have to make a change it means I have to open several copies of vi as well as testing the impact on all the scripts. When I use outside files like they are usually subs. I try to define an API for the the subs and and when I update one I can update the wy it handles the passed data so I generally don't hve to change the way the sub is called. One of these days I'm going to try to move them into a 'package' based system.
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.