addition of first_index to the native Array trait.
[gitmo/Moose.git] / lib / Moose / Meta / Attribute / Native / Trait / Array.pm
index 29916ec..a743c4d 100644 (file)
@@ -133,7 +133,7 @@ This method requires at least one argument.
 
 =item * B<first( sub { ... } )>
 
-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<List::Util>'s C<first> 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<first_index( sub { ... } )>
+
+This method returns the index of the first matching item in the array, just
+like L<List::MoreUtils>'s C<first_index> 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<grep( sub { ... } )>
 
 This method returns every element matching a given criteria, just like Perl's