Baldrick::Examples::ExampleDogsbody

From CunningPlans

Jump to: navigation, search

Baldrick::ExampleDogsbody is provided as part of the Baldrick distribution but is not loaded with the other Baldrick::* classes, nor is it intended to be instantiated or inherited from.

Rather, it is a template intended to be copied and given a new name by Module authors. It is an example of how to write a request handler (or "Dogsbody") that inherits from Baldrick::Dogsbody, showing what functions are typically added or overridden.

[edit] Usage

    ## Go to where the Baldrick perl modules are installed ("lib" within your CGI-BIN directory, usually).
    $ cd /var/www/example.com/cgi-bin/lib
    ## Make a directory for your [[Module]].
    $ mkdir MyNewApp
    ## Copy ExampleDogsbody into it, renaming to something appropriate.
    ## I recommend a name ending in "Handler" (in corporate environments) or "Dogsbody" (for fun projects). 
    $ cp Baldrick/ExampleDogsbody.pm MyNewApp/MyNewAppDogsbody.pm

After copying the file to a new directory and name, edit it, changing the "package" statement to match.

See Modules for more on creating a new module, of which the above is one step.

Personal tools