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

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (13)
As of 2016-10-25 18:19 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (326 votes). Check out past polls.