Perl module, global variables
what is the standard convention for specifying global, static variables in a perl module? for example, i want an '$admin' variable to be available at any point of execution which will contain an email address. i was thinking of just creating a 'GLOBALS' module that you can access variables by doing
use x::GLOBALS; my $x=new x::GLOBALS; $x->{'admin'}; and the 'new' will set all $self->{'admin'} like vars. how is this currently accomplished in the perl world? thanks |
Well, TMTOWTDI in Perl, but I do this just after my use ... declarations:
Code:
# Declare cfg pkg so we can refer to it anywhere Code:
if( $cfg::params{'DEBUG'} >= 1 ) Code:
|
All times are GMT -5. The time now is 09:37 PM. |