[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [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
> 
Hi Dan,

I changed my instance script to what you suggested.
Still have 'use CAP::ConfigAuto (qw/cfg cfg_file/)' in Base.pm
which is being referenced in MyApp with 'use base Base.pm'.
Don't know if that's the problem, but I'm getting exactly
the same error (must call cfg_file before cfg).

I'm still missing something.  Thanks.


---------------------------------------------------------------------
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.