Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: OO-style modifiers for 'sub' ?

by Anonymous Monk
on Jan 27, 2003 at 07:44 UTC ( #230164=note: print w/ replies, xml ) Need Help??


in reply to OO-style modifiers for 'sub' ?

Perl 5.6+ already have a 'method' attribute for subroutines (sub f : method { }), but it currently doesn't do much afaik. You're feature could easily be turned into an attribute itself, which wraps the the method with code to check that $_[0] is from the proper class.

On the other hand with good documentation for your code and a clear interface you shouldn't really need to check that a method is being called as a method anyways, because your interface should be consistent enough to make it obvious


Comment on Re: OO-style modifiers for 'sub' ?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2014-10-23 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls