This question was also posed on StackOverflow, where I answered the following.
Are you simply overcomplicating things, or am I missing something?
package Bucket; has '_linkedlist' => ( is => 'rw', isa => 'LinkedList', handles => { _add_link => 'append', _insert_link => 'insert', _count_links => 'size', _del_link => 'remove', _split_at_link => 'split', _has_sublinks => 'has_children', }, );
Hashes don't have methods, which is why a trait is involves. The trait adds the methods. Your LinkedList class has methods, so no need to write a trait to provide the methods.
In reply to Re: How do you create attribute handlers for methods of an object (via Moose) ?
by ikegami
in thread How do you create attribute handlers for methods of an object (via Moose) ?
by nodebunny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |