in reply to Re^22: Assignable Subroutines
in thread Assignable Subroutines

Okay, now extend those to allow any integer if

$self->anotherAttrib == 3;

With the validation inline, it has complete access to everything that the sub has access to.

And 90% of all those specialist traits are just single lines of Perl blown up into complicated layers of abstraction, that will never be reused, and serve only to add complexity, where none is warrented.


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.

Replies are listed 'Best First'.
Re^24: Assignable Subroutines
by Aristotle (Chancellor) on Jan 27, 2005 at 20:04 UTC

    complicated layers of abstraction, that will never be reused, and serve only to add complexity, where none is warrented.

    Obviously!

    Also, see Re^18: Assignable Subroutines for how a setter might be attached inline to handle your stateful validation requirement.

    Makeshifts last the longest.