govindkailas has asked for the wisdom of the Perl Monks concerning the following question:
Hi All,
I have defined some system specific variables in a .pm file and wanted to use those variables in all the perl scripts which use the .pm.
This is how my Utilities.pm looks like
And here is the .pl filepackage Utilities; use Exporter; @EXPORT = ($SYS_DIR); our $SYS_DIR="/path/to/sys"; 1;
use Utilities; use strict; print "This is the value for SYS_DIR=$SYS_DIR";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Better way to define global variables
by choroba (Cardinal) on Jul 25, 2013 at 13:44 UTC | |
Re: Better way to define global variables
by Athanasius (Archbishop) on Jul 25, 2013 at 14:03 UTC | |
Re: Better way to define global variables
by kcott (Archbishop) on Jul 25, 2013 at 14:36 UTC | |
Re: Better way to define global variables
by davies (Prior) on Jul 25, 2013 at 14:28 UTC | |
Re: Better way to define global variables
by MidLifeXis (Monsignor) on Jul 25, 2013 at 13:51 UTC | |
Re: Better way to define global variables
by hdb (Monsignor) on Jul 25, 2013 at 14:02 UTC |
Back to
Seekers of Perl Wisdom