zby has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I decided to try the new merlyn's CGI library, but I have problems with starting an even most simple application. From the documentation:
The name of the state is appended to an application-wide package prefix to determine an appropriate class to handle the request. ... The default class is My::App, but this can be overridden. The default state is welcome, but this too can be overridden.
Does it mean I need following files for a one page app? The My::App::welcome module should be derived from CGI::Prototype::Hidden? Should there be any thing in this module for a basic working page? Or perhaps an empty class (with no additional or overriden methods) would be enough to display the My/App/welcome.tt template?

Replies are listed 'Best First'.
Re: basic CGI::Prototype::Hidden
by merlyn (Sage) on Jan 18, 2005 at 16:19 UTC
    An example application will be added within a few weeks, thanks to my silent co-contributor. This will also be the test app so I can have better test coverage.

    But yes, you got everything correct. If your My::App and My::App::welcome classes have no additional methods, then welcome.tt will indeed be displayed. Any suggestions for doc improvements are also welcome... the ::Hidden class is pretty underdocumented at the moment because of lack of examples.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Thank you. One more question - what should go into My::App?
        Well, "welcome" is one page, so you put methods that are page-specific there. "My::App" is the application, so you put methods and data that are application-wide there, including the setting of those config variables.

        -- Randal L. Schwartz, Perl hacker
        Be sure to read my standard disclaimer if this is a reply.

Re: basic CGI::Prototype::Hidden
by dragonchild (Archbishop) on Jan 18, 2005 at 16:14 UTC
    Look at Review: CGI::Prototype, especially merlyn's replies, for more info.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      I read it quite carefully but, unfortunately I did not found any answer to the specified questions. Did I miss something?