On Wed, Jan 13, 2010 at 11:52:46AM -0500, Hans Dieter Pearcey wrote:
> You wrote 'around x' in your example.  Do you really mean around the accessor?

Yes

> What if someone uses your trait with reader => 'get_x', writer => 'set_x'?

I don't know, it but wouldn't make sense in the context of that accessor anyway.

> What's the end result you want? (Not "I want to around() a method", but "I 
> want
> to clear a value on update" or "I want to do some other processing on reading"
> or whatever.)

I'd like to use array and hash attributes in mixed list and array contexts:

   @list = $obj-> prop;
   $obj->prop(@list);
   $array = $obj->prop;
   $obj->prop($array);

I though I could do that with "around":

   has prop;
   around prop => \&my_accessor;

-- 
Sincerely,

        Dmitry Karasik



Reply via email to