Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Private Class Methods

by pdcawley (Hermit)
on Apr 06, 2002 at 18:55 UTC ( #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? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2022-08-13 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?