
Object::Array::Plugin::Builtins

See Object::Array.
Provides analogues to Perl's built-in array operations.

sizelengthReturns the number of elements in the array.
size and length are synonyms.
elementelemprint $array->elem(0); print $array->[0];
Get a single element's value.
$array->elem(1 => "hello"); $array->[1] = "hello";
Set a single element's value.
element and elem are synonyms.
slice print for $array->slice([ 0, 1, 2 ]);
print for @{$array}[0,1,2];
Get multiple values.
$array->slice([ 0, 1, 2 ] => [ qw(a b c) ]);
@{$array}[0,1,2] = qw(a b c);
Set multiple values.
elementselemsShortcut for all values in the array.
elements and elems are synonyms.
NOTE: Using methods in a for/map/etc. will not do aliasing via $_. Use array dereferencing if you need to do this, e.g.
$_++ for @{$array};
clearErase the array. The following all leave the array empty:
$array->size(0);
$array->clear;
@{ $array } = ();
pushpopshiftunshiftexistsdeletesplicemapgrepjoinAs the builtin array operations of the same names.
Note that since map and grep are called as methods, you must use <sub { }> (no bare blocks).