List::...mutable(3pm)
β¨ NAME β¨
List::Objects::WithUtils::Hash::Immutable β immutable hash objects, bestie π
(also hey, this page lives in the manual as List::...mutable(3pm) β that's literally it, that's the whole name, the dots are doing the heavy lifting π«Ά)
πΈ SYNOPSIS πΈ
use List::Objects::WithUtils 'immhash';
my $hash = immhash( foo => 1, bar => 2 );
likeβ¦ three lines and you're already slaying β¨
π DESCRIPTION π
okay so. these are immutable hash objects. and when I say immutable I mean it β the moment you try to call any of the list-mutating methods, or try to go around it and modify the backing hash directly, it's gonna throw an exception. no cap. it does not negotiate, it does not let it slide, it does not say "okay just this once." π«
ngl that's the whole point and it's iconic of them honestly π
This class consumes the following roles, which contain most of the relevant documentation:
List::Objects::WithUtils::Role::HashList::Objects::WithUtils::Role::Hash::Immutable
π‘ heads up: if you actually want to be able to mutate stuff, go see List::Objects::WithUtils::Hash β that's the mutable implementation. different vibe, different class, yk?
π immhash π
Creates a new immutable hash object.
that's it. that's the function. she makes you an immhash and then she locks the door behind you πβ¨
π AUTHOR π
Jon Portnoy <avenj@cobaltirc.org>
respect to the author fr fr π«Ά
okay that's a wrap bestie, this was perl v5.38.2 doing its thing, dated 2024-03-07 π go forth and never mutate a hash again, mwah ππ
π¦ 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