Puma::ServerPages
|
|
GLOBAL OBJECTS
There are two objects that are imported by default into the
Puma::ServerPages environment: %ENV and
$server .
The %ENV object is a hash table of environment variables
that is a standard part of Perl with added values from Apache and
Puma::ServerPages .
If you want to see the content if this hash, look at it using
Data::Dumper .
The
$server object is an instantiation of the
Puma::ServerPages::Server module.
It provides functionality similar to the CGI object.
The $server object provides a number of functions for
cookie and stateful object management (which we won't cover here) and a
number of other useful methods:
STATEFUL OBJECTS
Puma has full support for stateful objects, and they're all configured
dynamically to boot.
By default, the /etc/puma/config.xml has two stateful
objects defined:
the $session and the $user objects.
The $session object lives for the length of the browser
session and the $user object lives for 30 days.
Both are serialized in the $ENV{DOCUMENT_ROOT}/state
directory.
All of these parameters are configurable in the global
config.xml .
Using the
$session and $user objects is a
simple task - they're just hash references that will hold their values
between pages.
|