I inspected some other methods in the same directory (e.g. map), which uses _return_value instead, but sort_in_place is much better because it shows how to modify the elements of the list. Thank again for pointing me to it. However, it still doesn't really modify the values in place: it returns a reference to a new anonymous array containing the new values.
Update: I had to quotequote InvalidArgumentToMethod in the code, otherwise I got
> Could not create writer for list because Failed to compile source: Bareword "InvalidArgumentToMethod" not allowed while "strict subs" in use at native delegation method My::apply_to_list (apply) of attribute list
$self->_inline_throw_exception( '"InvalidArgumentToMethod"' => 'argument => $_[0],'. 'method_name => "apply",'. 'type_of_argument => "code reference",' +. 'type => "CodeRef",',
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
In reply to Re^2: Moose Trait to Add a Method to an Attribute ( Moose/Meta/Method/Accessor/Native/Array/apply.pm )
by choroba
in thread Moose Trait to Add a Method to an Attribute
by choroba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |