|go ahead... be a heretic|
Re: using 'my'by Elgon (Curate)
|on Jun 21, 2001 at 19:21 UTC||Need Help??|
Fret ye not: This is not a lame question but rather relates to an article of the faith for Perlmonks.
The strict answer to your question (excuse the bad pun) is no, you do not need to declare the variables if you are not using the strict pragma. This means you will need to declare all of your variables using my which is generally agreed to be a good idea.
A slightly better answer is that you should (nearly) always use strict; and preferably the -w switch or the warnings pragma too (These two are very slightly different if you're using Perl 5.6 or later, see this for more info.) If there is a good reason why you shouldn't be using strict there is probably a far better and/or safer way of doing what you are trying to do!
There are lots of very good reasons why you should use strict; and warnings and if you are doing CGI work -T too: You will be warned about typos in your variable names because the code won't run and will give you the location of the (probable) typo, warnings will give you more useful debugging information about nonfatal errors in your code and -T, well let's just say that it can make life a more pleasant experience for everybody except anyone trying to do unpleasant things to your website. All of the links given by the other posters will be damned helpful, good luck.
PS: Oh, and welcome to <a href="http://"www.perlmonks.org">Perlmonks!
"Without evil there can be no good, so it must be good to be evil sometimes.