part
# given [1..10]
$array->part(fun ($value) { $value > 5 }); # [[6, 7, 8, 9, 10], [1, 2, 3, 4, 5]]
The part method iterates over each element in the array, executing the code reference supplied in the argument, using the result of the code reference to partition to array into two distinct array references. This method returns an array reference containing exactly two array references. This method returns a Data::Object::Array object.
part(CodeRef $arg1, Any $arg2) : Tuple[ArrayRef, ArrayRef]
method
5 POD Errors
The following errors were encountered while parsing the POD:
- Around line 10:
Unknown directive: =name
- Around line 14:
Unknown directive: =usage
- Around line 20:
Unknown directive: =description
- Around line 28:
Unknown directive: =signature
- Around line 32:
Unknown directive: =type