elusion has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that the above code is a no no in mod_perl, where $new_obj will live between requests. The New class loads information from cookies and grants privileges, so I can't have this. How can I create a $new_obj for every request in the Legacy package or otherwise solve my problem?package Legacy; $new_obj = New->new(); sub Ugly_Sub_Name { $new_obj->pretty_method; } package New; sub new { ... } sub pretty_method { ... } package main; use Legacy; # should return the value from New->pretty_method print Legacy::Ugly_Sub_Name, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mod_perl and forwarding legacy functions to a global object
by Fletch (Bishop) on Jun 25, 2004 at 17:53 UTC | |
by elusion (Curate) on Jun 25, 2004 at 18:15 UTC | |
by derby (Abbot) on Jun 25, 2004 at 18:40 UTC | |
|
Re: mod_perl and forwarding legacy functions to a global object
by perrin (Chancellor) on Jun 25, 2004 at 19:28 UTC | |
|
Re: mod_perl and forwarding legacy functions to a global object
by Zaxo (Archbishop) on Jun 25, 2004 at 17:52 UTC | |
by elusion (Curate) on Jun 25, 2004 at 17:54 UTC | |
|
Re: mod_perl and forwarding legacy functions to a global object
by Juerd (Abbot) on Jun 25, 2004 at 17:51 UTC | |
|
Re: mod_perl and forwarding legacy functions to a global object
by dragonchild (Archbishop) on Jun 28, 2004 at 12:27 UTC |