Discuss Scope of variables declared in main in the Perl Programming forum on Dev Shed. Scope of variables declared in main Perl Programming forum discussing coding in Perl, utilizing Perl modules, and other Perl-related topics. Perl, the Practical Extraction and Reporting Language, is the choice for many for parsing textual information.
Time spent in forums: 6 Days 13 h 57 m 12 sec
Reputation Power: 474
Lexical variables that are declared outside any function or block generally have a scope from the place where they are defined until the end of the file. This makes them sort of "global" variables, but it is rarely a very good idea to use them as such.