The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Contentment::Context - Contextual information for a Contentment request

SYNOPSIS

  package Contentment::MyModule;

  use strict;
  use warnings;

  sub Contentment::Context::my_module {
      my $ctx = shift;
      return $ctx->{my_module};
  }

  1;

DESCRIPTION

The context contains information about the application and the current request-response cycle.

If you need access to the current context object, you can always retrieve it by calling:

  my $context = Contentment->context;

See Contentment for details.

CONTEXT METHODS

To create your own context methods, just drop a method into the Contentment::Context class from your own module:

  sub Contentment::Context::my_method { 1 }

It's recommended that your method throw an exception on error or if it is accessed before it becomes available or after it is no longer available. This will help during debugging.

AUTHOR

Andrew Sterling Hanenkamp, <hanenkamp@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2005 Andrew Sterling Hanenkamp <hanenkamp@cpan.org>. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.