Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Is this call frowned upon? &method($objectref, $more_params)?

by merlyn (Sage)
on May 28, 2000 at 21:34 UTC ( [id://15207]=note: print w/replies, xml ) Need Help??


in reply to Is this call frowned upon? &method($objectref, $more_params)?

Why not just
$objectref->method(@more_params)
? What are you gaining by your "method" (heh) except the chance to miss out on inheritance?

Replies are listed 'Best First'.
RE: Answer: Is this call frowned upon? &method($objectref, $more_params)?
by rvbijl (Initiate) on May 30, 2000 at 05:17 UTC
    The reason being is that I have a of languageX => \&init_languageX, and I want to just get the method funciton from the hash instead of doing a lot of ifs. But, i couldn't get the call to work without doing it my way. Why would it lose out on inherritance, if $self we got it like this:
    sub set_lang { my $self = shift; my $lang = shift; ... &{$lang_to_func{$lang}}(...); }
    --
    Ryan -- http://www.calvin.edu/~rvbijl39

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found