Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: mod_perl and forwarding legacy functions to a global object

by Zaxo (Archbishop)
on Jun 25, 2004 at 17:52 UTC ( [id://369690]=note: print w/replies, xml ) Need Help??


in reply to mod_perl and forwarding legacy functions to a global object

The old Legacy probably didn't have objects hanging around, so how about restricting the object to a lexical scope?

package Legacy; sub Ugly_Sub_Name { my $new_obj = New->new(); $new_obj->pretty_method; }
Even just making the object a file scoped lexical would work, but I don't see a need to make a closure on it.

After Compline,
Zaxo

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 17:54 UTC
    The problem is there's more than one Ugly_Sub_Name and it doesn't make sense to make a new object (it's a bit of work) on every subroutine call.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://369690]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-28 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found