We're using CGI::Application::Plugin::Config::Simple to read in configuration data, including a definition for library, where our respective sandboxes are stored.
Its loading the cpan installed modules already in @INC, just fine. But its tripping up on this piece of it:
# cgiapp_init();
sub cgiapp_init {
my $self = shift;
$self->config_file('/var/lib/cf/tbd/regform/Registration.ini');
my $lib = $self->config_param('library');
use lib qw/$lib/;
use Registration::WWW::htmlgui;
use Registration::DB;
my $dbh = Registration::DB->connect($self->config_param('db_engine'),$self->config_param('host_name'),$self-
>config_param('db_name'),$self->config_param('db_user'),$self->config_param('db_pw'));
my $result = auth_config($dbh);
}
At which point it throws these ugly errors, reading:
Use of uninitialized value in string at Registration/lib/Registration/WWW/RegForm.pm line 46. Empty compile time value given to use lib at Registration/lib/Registration/WWW/RegForm.pm line 46Apparently it wants to be able to do its use lib piece at compile time, but it doesn't get populated from the configuration until run time. Can anyone here suggest a work-around, please?
All help appreciated.
-- Hugh
To summarize:
my $lib = $self->config_param('library');
push @INC, $lib;
# uncomment the calls to import if needed
require Registration::WWW::htmlgui; # import Registration::WWW::htmlgui;
require Registration::DB; # import Registration::DB;
perlmonks.org content © perlmonks.org and hesco, rhesa, Roy Johnson
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03