in reply to Re^2: Remove roles for an object in perl moose
in thread Remove roles for an object in perl moose
The handles => ['teach'] bit is really just a shortcut for writing something like:
sub teach { (shift->teacher or die)->teach(@_); }
It's not especially sophisticated - e.g. it doesn't make can("teach") return false if teacher is not set. But it's a useful technique for observing the Law of Demeter.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Remove roles for an object in perl moose
by Anonymous Monk on Sep 29, 2013 at 18:23 UTC | |
by tobyink (Canon) on Sep 29, 2013 at 23:54 UTC | |
by rbala (Acolyte) on Oct 01, 2013 at 09:12 UTC | |
by tobyink (Canon) on Oct 01, 2013 at 21:47 UTC | |
by tobyink (Canon) on Oct 01, 2013 at 19:03 UTC |