X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute%2FNative%2FTrait%2FArray.pm;h=a7046a2e51e75a40653bee5f5a066b4e82c09192;hb=e4fdfb589a1c4b66e5cbb3098d1137e1715a3261;hp=29916ec2fd79e78062c4ae7a146afcbdcfd5d1d6;hpb=e818d161706d5dedaf22d0a48675db599daf0fc2;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Attribute/Native/Trait/Array.pm b/lib/Moose/Meta/Attribute/Native/Trait/Array.pm index 29916ec..a7046a2 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait/Array.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait/Array.pm @@ -133,7 +133,7 @@ This method requires at least one argument. =item * B -This method returns the first item matching item in the array, just like +This method returns the first matching item in the array, just like L's C function. The matching is done with a subroutine reference you pass to this method. The subroutine will be called against each element in the array until one matches or all elements have been checked. @@ -143,6 +143,16 @@ element in the array until one matches or all elements have been checked. This method requires a single argument. +=item * B + +This method returns the index of the first matching item in the array, just +like L's C function. The matching is done with a +subroutine reference you pass to this method. The subroutine will be called +against each element in the array until one matches or all elements have been +checked. + +This method requires a single argument. + =item * B This method returns every element matching a given criteria, just like Perl's @@ -284,12 +294,21 @@ This method accepts one or two arguments. =item * B This method returns an iterator which, on each call, returns C<$n> more items -from the array, in order, like C from L. A coderef -can optionally be provided; it will be called on each group of C<$n> elements -in the array. +from the array, in order, like C from L. + +If you pass a coderef as the second argument, then this code ref will be +called on each group of C<$n> elements in the array until the array is +exhausted. This method accepts one or two arguments. +=item * B + +This method returns a shallow clone of the array reference. The return value +is a reference to a new array with the same elements. It is I +because any elements that were references in the original will be the I +references in the clone. + =back =head1 BUGS