Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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?

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 scrutinizing the Monastery: (5)
As of 2015-11-28 14:46 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (742 votes), past polls