Object:...Builtins(3)
πΈ NAME πΈ
okay so this is the Object:...Builtins(3) page from the user-contributed Perl docs, and it's all about Object::Array::Plugin::Builtins β that's the NAME, periodt. π
β¨ SYNOPSIS β¨
See Object::Array.
Provides analogues to Perl's built-in array operations. slay. π¦
π METHODS π
π size / length π
Returns the number of elements in the array. literally just the count, bestie. β¨
size and length are synonyms. iykyk. π
π element / elem π
Get a single element's value:
print $array->elem(0);
print $array->[0];
Set a single element's value:
$array->elem(1 => "hello");
$array->[1] = "hello";
element and elem are synonyms. π«Ά
π¦ slice π¦
Get multiple values:
print for $array->slice([ 0, 1, 2 ]);
print for @{$array}[0,1,2];
Set multiple values:
$array->slice([ 0, 1, 2 ] => [ qw(a b c) ]);
@{$array}[0,1,2] = qw(a b c);
π elements / elems π
Shortcut for all values in the array.
elements and elems are synonyms.
NOTE: Using methods in afor/map/etc. will not do aliasing via$_. Use array dereferencing if you need to do this, e.g.
$_++ for @{$array};
π§ clear π§
Erase the array. The following all leave the array empty:
$array->size(0);
$array->clear;
@{ $array } = ();
π₯ push / pop / shift / unshift / exists / delete / splice / map / grep / join π₯
As the builtin array operations of the same names. no cap. π
Note that sincemapandgrepare called as methods, you must use"<sub { }>"(no bare blocks).
π cute sign-off: this page is from perl v5.42.2, dated 2026-02-15. bye bestie, go slay those arrays! π«Άβ¨
π¦ where this page comes from
- alpine 3.24: perl-object-array-doc 0.060-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms