D
Debo
Hello there,
I'd like to set up my application so that a whole bunch of global
'constants' are available merely by including the file somehow.
The gist of what I'm trying to do is something like this:
***In constants.pl:
my $constant1 = 'some value';
my $constant2 = 'some other value';
***In somefile.pl:
require constants.pl;
if ('hello' eq $constant1)
{
....
}
This sort of thing is done is C/C++ all the time by including header files
or something hackish like that... that's along the lines of what I'm
trying to do.
I use strict everywhere, so scope will be an issue I imagine. Also, I
don't like to use the constants package because I tend to use these
'constants' in between double/interpolated quotes all the time.
Any suggestions? I'm open to anything that will allow me to store all of
my constant filepaths etc. in a single file. I'm sorry if the way to do
this is obvious in the documentation somewhere, I just haven't been able
to figure it out.
Thanks,
-Debo
I'd like to set up my application so that a whole bunch of global
'constants' are available merely by including the file somehow.
The gist of what I'm trying to do is something like this:
***In constants.pl:
my $constant1 = 'some value';
my $constant2 = 'some other value';
***In somefile.pl:
require constants.pl;
if ('hello' eq $constant1)
{
....
}
This sort of thing is done is C/C++ all the time by including header files
or something hackish like that... that's along the lines of what I'm
trying to do.
I use strict everywhere, so scope will be an issue I imagine. Also, I
don't like to use the constants package because I tend to use these
'constants' in between double/interpolated quotes all the time.
Any suggestions? I'm open to anything that will allow me to store all of
my constant filepaths etc. in a single file. I'm sorry if the way to do
this is obvious in the documentation somewhere, I just haven't been able
to figure it out.
Thanks,
-Debo