| Sign In/My Account | View Cart |
|
|
We've expanded our Perl news coverage and improved our search! Search for all things Perl across O'Reilly!
21.13. Sharing Information Between Handlers21.13.1. ProblemYou want to share information between handlers, but global variables are global to a process and not automatically cleaned up after every request. 21.13.2. SolutionUse Apache pnotes (Perl notes):
21.13.3. DiscussionApache modules communicate with each other using notes (see Recipe 21.11). Apache notes act like a hash attached to a request—one handler stores a value for a key in the hash, so that another handler can read it later. The Perl notes features is also a hash attached to the request object, but it's only for the Perl handlers. To set a pnote, pass a key and a value to the $r->pnotes method. To retrieve a pnote, pass only the key. You can store complex data structures:
and even objects:
View the past week's recipes: Today | Yesterday | 3 days ago | 4 days ago | 5 days ago | 6 days ago | A week ago
|
|
Sponsored By: |