> -----Original Message-----
> From: Jonathan Mangin
> Sent: Monday, 20 February 2006 5:21 a.m.
> To: suppressed
> Subject: [cgiapp] PARAMS and CAP::ConfigAuto
>
> Trying to follow the docs in CAP::ConfigAuto moving cfg_file
> definition to the instance script:
>
> #!/usr/bin/perl -wT
> use lib qw(.);
> use App1;
> my $webapp = App1->new(PARAMS => {cfg_file => 'config/app1.conf'});
> $webapp->run();
>
> And in Base.pm:
>
> use CGI::Application::Plugin::ConfigAuto (qw/cfg cfg_file/);
>
> sub cgiapp_init {
> my $self = shift;
> # $self->cfg_file('config/app1.conf');
> my $DB_NAME = $self->cfg('DB_NAME');
> <snip>
>
Try the following in your instance script
#!/path/to/perl -T
use strict;
use MyApp;
my $webapp = MyApp->new();
$webapp->cfg_file('myapp.cfg');
$webapp->run();
And put the following in your MyApp.pm package
use CGI::Application::Plugin::ConfigAuto (qw/cfg cfg_file/);
I don't know if this is the way that should be done - I got a little
confused too - but it works for me
Dan
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.