in reply to mod_perl and forwarding legacy functions to a global object
Create an instance in an init handler and stash it in $r->notes. Write procedural wrappers which retrieve that instance and call the appropriate methods. That instance will only exist for the lifetime of the one request.
Addendum: This also has the advantage of allowing new code to access the already existent instance and call the methods directly as well (either by using an already existing request record or by using Apache->request->notes).
Update: Ooop, as is pointed out below I meant pnotes which lets you store an arbitrary perl value. That's what one gets after getting spoiled by HTML::Mason doing everything for you. :)
|Replies are listed 'Best First'.|
Re^2: mod_perl and forwarding legacy functions to a global object
by elusion (Curate) on Jun 25, 2004 at 18:15 UTC
by derby (Abbot) on Jun 25, 2004 at 18:40 UTC