Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

( #15207=categorized answer: print w/ replies, xml ) Need Help??

Q&A > object-oriented programming > Is this call frowned upon? &method($objectref, $more_params)? contributed by merlyn

Why not just
? What are you gaining by your "method" (heh) except the chance to miss out on inheritance?

Comment on Answer: Is this call frowned upon? &method($objectref, $more_params)?
Download Code
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 --
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2015-10-07 16:56 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (191 votes), past polls