T
Tony
Hi,
I try to set a config file using constant. I put all the configuration in
Package/Config.pm as constant, and other program can get this
configuration by use Package::Config. It looks like this:
$ cat /var/www/lib/Package/Config.pm
package Package::Config;
use strict;
use constant ADMIN_NAME => 'My Name';
1;
$ cat /var/www/lib/Package/test.pl
#!/usr/bin/perl
use strict;
use lib "/var/www/lib";
use Package::Config;
print "Admin Name: " . $Package::Config::ADMIN_NAME . "\n";
Why this doesn't work? Please help, thanks very much.
Tony.
I try to set a config file using constant. I put all the configuration in
Package/Config.pm as constant, and other program can get this
configuration by use Package::Config. It looks like this:
$ cat /var/www/lib/Package/Config.pm
package Package::Config;
use strict;
use constant ADMIN_NAME => 'My Name';
1;
$ cat /var/www/lib/Package/test.pl
#!/usr/bin/perl
use strict;
use lib "/var/www/lib";
use Package::Config;
print "Admin Name: " . $Package::Config::ADMIN_NAME . "\n";
Why this doesn't work? Please help, thanks very much.
Tony.