I agree with all of those who say to 'use strict." However, using strict does not necessarily require the use of lexicals declared with my(). You may if you wish simply append main::
in front of all of your variables. That will declare your variables as global, which they already are anyway if you are not declaring them with my().
(Side note: Perl does not have true global variables. All variables exist only in the package in which they are defined. However, because main:: is the default package, variables that are non-lexical in main appear almost as if they are global.)
One point on 'use strict'. My brother has a magnificent e-commerce site written completely in Perl 5.00x It supports his entire family very nicely.
He does not 'use strict'! I told him that what he was doing was 'blasphemy.' He said that he does not view using Perl as a religious act. I cannot argue with success, but I will always use strict, and where possible I convert scripts written by others to strict when I maintain them.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.