in reply to Re: One line CGI::Application instance script
in thread One line CGI::Application instance script

What parameters? CGI::Application needs absolutely nothing from the instance script. It's merely a boostrap. Everything comes from the CGI instance, which C::A handles as part of the run() method.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

  • Comment on Re: Re: One line CGI::Application instance script

Replies are listed 'Best First'.
Re: Re: Re: One line CGI::Application instance script
by diotalevi (Canon) on Apr 21, 2004 at 12:37 UTC

    I pass my configuration into the CGI::Application object. Of course, that change to operating everything during BEGIN is somewhat unusual as well. The perl interpreter running the parent's code doesn't reach INIT, CHECK or the normal runtime until the ->run call has completed. I wonder if that would cause problems for anyone or if fatal errors would interact poorly since to perl, this is all during the code-parsing stage.

    PerlMonks::Summoner -> new ( TMPL_PATH => TEMPLATEROOT . 'PerlMonks_Summoner/', PARAMS => { encryption_key => ..., url => ..., dbh => undef, change => undef, dbi_dsn => 'dbi:Pg:dbname=perlmonks', dbi_username => 'perlmonks', dbi_password => '...', }, )->run;