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

Re: Private Class Methods

by pdcawley (Hermit)
on Apr 06, 2002 at 18:55 UTC ( [id://157174]=note: print w/replies, xml ) Need Help??


in reply to Private Class Methods

You could always wait for Perl 6.
class Foo { my method bar {...} }
et viola! only Foos can call bar. Sorry if that's not exactly helpful. The other option is:
sub bar { croak "Oi! You're not a foo!" unless $_[0]->isa(__PACKAGE__); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-24 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found