Object:...Builtins(3)

πŸ“¦ version 0.060, in alpine 3.24

🌸 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 a for/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 since map and grep are 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