Gabor Szabo wrote:
> Hi,
> 
> I was about to try to use CGI::Application::Plugin::Config::Simple but I
> wonder
> how to set defaults?
> 
> As I don't want to make the config file a requirement I put in a condition
> to read it only
> 
> sub cgiapp_init {
>    my ($self) = @_;
>    my $file = $self->param('ROOT') . "/ostd.ini";
>    if (-e $file) {
>        $self->config_file($file);
>    }
> }
> 
> but then if I call
>   $self->config_param('die_on_bad_params')
> the code dies with the following message in the apache log:
>
> How can I make the config file optional?

You can't currently. You could have some fun with eval, but might look a little
ugly....

  my $die_badly = eval { $self->config_param('die_on_bad_params') } || 0;

But it definitely sounds like a useful feature.

Currently I'm not really using C::A::P::C::S, but I will accept patches. In
fact, if anyone wants to take over maintenence of it, I'd gladly pass it on.

-- 
Michael Peters
Developer
Plus Three, LP


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to