GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CATALYST::MIDDLEWARE::STASH (3)

.ds Aq ’

NAME

Catalyst::Middleware::Stash - The Catalyst stash - in middleware

CONTENTS

DESCRIPTION

We’ve moved the Catalyst stash to middleware. Please don’t use this directly since it is likely to move off the Catalyst namespace into a stand alone distribution

We store a coderef under the PSGI_KEY which can be dereferenced with key values or nothing to access the underlying hashref.

Anything placed into the stash will be available in the stash of any ’mounted’ Catalyst applications. A mounted Catalyst application may set the stash and ’pass back’ information to the parent application. Non Catalyst applications may use this middleware to access and set stash values.

Please note I highly recommend having a stronger interface than a stash key between applications.

For more information the current test case t/middleware-stash.t is the best documentation.

SUBROUTINES

This class defines the following subroutines.

    PSGI_KEY

Returns the hash key where we store the stash. You should not assume the string value here will never change! Also, its better to use get_stash or stash.

    get_stash

Expect: $psgi_env.

Exportable subroutine.

Get the stash out of the $env.

    stash

Expects: An object that does env and arguments

Exportable subroutine.

Given an object with a method env get or set stash values, either as a method or via hashref modification. This stash is automatically reset for each request (it is not persistent or shared across connected clients. Stash key / value are stored in memory.



    use Plack::Request;
    use Catalyst::Middleware::Stash stash;

    my $app = sub {
      my $env = shift;
      my $req = Plack::Request->new($env);
      my $stashed = $req->stash->{in_the_stash};  # Assume the stash was previously populated.

      return [200, [Content-Type => text/plain],
        ["I found $stashed in the stash!"]];
    };



If the stash does not yet exist, an exception is thrown.

METHODS

This class defines the following methods.

    call

Used by plack to call the middleware
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CATALYST::MIDDLEWARE::STASH (3) 2015-11-07

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.