Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 exploiting the Monastery: (5)
As of 2014-07-13 12:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (249 votes), past polls