Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Answer: How do I reference methods?

by ariels (Curate)
on Aug 20, 2001 at 17:34 UTC ( #106216=categorized answer: print w/replies, xml ) Need Help??

Q&A > object-oriented programming > How do I reference methods? - Answer contributed by ariels

See my note on pointers to member functions.

That code lets you say:

use PMF; my $p = PMF->new('print'); $p->$o(123); # Call $o->print(123) $p->$x('a','b'); # Call $x->print('a','b') $p->$z(); # Call $z->print

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[thezip]: What idiom should I use to determine that a directory is empty (for many directories)?
[thezip]: I suppose could check if readdir() returns other than '.' and '..', but that seems ugly.

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2017-03-28 18:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (339 votes). Check out past polls.