more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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. In reply to Re: using 'my'
by sierrathedog04
|
|