List::...utable(3pm)
π NAME π
List::Objects::WithUtils::Role::Array::Immutable β bestie, it's giving immutable array behavior β¨
πΈ SYNOPSIS πΈ
# Via List::Objects::WithUtils::Array::Immutable ->
use List::Objects::WithUtils 'immarray';
my $array = immarray(qw/ a b c /);
$array->push('d'); # dies
See that last line? Yeah. It dies. The array said no. Iconic behavior honestly π
π¦ DESCRIPTION π¦
Okay so listen β this role is the chill-but-firm friend who adds immutable behavior to anyone consuming List::Objects::WithUtils::Role::Array. Once you're in this role, the array is locked in. No take-backs. No edits. It's giving "we're not doing that today" energy π
The following methods are not available and will throw an exception if you even try:
clearsetpop pushshift unshiftdelete delete_wheninsertrotate_in_placesplice
Likeβ¦ don't even attempt it, bestie. It's not a vibe check you're gonna pass. π
(The backing array is also marked read-only.) So it's locked from every angle, no cap πβ¨
Wanna actually use this thing? Peep List::Objects::WithUtils::Array::Immutable β that's a consumer implementation that also pulls in List::Objects::WithUtils::Role::Array & List::Objects::WithUtils::Role::Array::WithJunctions. Two-for-one slay π«Ά
π AUTHOR π
Jon Portnoy <avenj@cobaltirc.org>
Licensed under the same terms as Perl. π
And that's the whole page, bestie β brought to you by perl v5.38.2, dated 2024-03-07, from the User Contributed Perl Documentation squad. Go forth and don't mutate anything ππΈ
π¦ where this page comes from
- debian trixie: liblist-objects-withutils-perl 2.028003-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liblist-objects-withutils-perl 2.028003-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblist-objects-withutils-perl 2.028003-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms