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

NAME

Wurm::mob - Meal OBject. You asked.

SYOPSIS

  use Wurm qw(mob);

  ...

  sub handler {
    my $meal = shift;

    $meal->log->({level => 'debug', message => 'Meal OBjects!'});

    $meal->res->header('Content-Type', 'text/plain');
    $meal->res->content('Hi, '. $meal->req->address. '!');
    return $meal->res;
  }

  ...

DESCRIPTION

Tired of crummy old HASHes in your request handlers? Upgrade them with the power of mob! There are two ways:

  use Wurm::mob;

- or -

  use Wurm qw(mob);

ADDITIONS

It wouldn't be correct to enable OO without adding some stuff! Here are some additions to the meal that each of your request handlers will enjoy:

req

Set to a Plack::Request object created with the current $env. First class meals for first class requests. Can also be accessed with request().

res

Set to a Plack::Response object wth the status set to 200. Provides a very convenient way to generate PSGI responses and finalize() will be called for you. Can also be accessed with response().

ACCESSORS

The following accessors are provided for ease-of-abuse:

mind
env
log
req
res
tube
seen
grit
vent

THE BAD NEWS

If mob is loaded, Wurm will automatically upgrade all incoming requests to use Wurm::mobs for all meals for all applications. For ever. If you need to turn this behavior off in a particular application, you can add mob => 0 to your folding ruleset and meals will remain a HASH.

SEE ALSO

Wurm

AUTHOR

jason hord <pravus@cpan.org>

LICENSE

This software is information. It is subject only to local laws of physics.