Data::...oseLike(3pm)
π Data::Perl::Collection::Hash::MooseLike β the manual, but make it cute
okay bestie so this page is Data::...oseLike(3pm) from the User Contributed Perl Documentation, and honestly it's giving "small module, huge personality." sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
Data::Perl::Collection::Hash::MooseLike β a Collection::Hash subclass that simulates Moose's native traits. no cap, that's literally its whole job π«Ά
πΈ VERSION πΈ
version 0.001009
π SYNOPSIS π
use Data::Perl::Collection::Hash::MooseLike;
my $hash = Data::Perl::Collection::Hash::MooseLike->new(a => 1, b => 2);
$hash->values; # (1, 2)
$hash->set('foo', 'bar'); # (a => 1, b => 2, foo => 'bar')
like. look at her. creating a hash, pulling values, adding a key. main character energy fr fr π
π DESCRIPTION π
This class provides a wrapper and methods for interacting with a hash. Every single method is written to emulate/match existing behavior that exists with Moose's native traits. so if you already know how Moose native traits do it, you already know how this does it β it's a vibe match, on purpose β¨
π¦ DIFFERENCES IN FUNCTIONALITY π¦
okay so this is where we get specific, and you KNOW I love specifics:
get($key, $key, ...)
Returns values from the hash.
In list context it returns a list of values in the hash for the given keys. In scalar context it returns the value for the last key specified. so like, context matters, always has, always will π
set($key, $value, ...)
Sets the elements in the hash to the given values. It returns the new values set for each key, in the same order as the keys passed to the method. cute, consistent, slay.
β οΈ heads up bestie: this method requires at least two arguments, and expects an even number of arguments. odd numbers of args? not the move, she will not be having it π
delete($key, $key, ...)
Removes the elements with the given keys.
In list context it returns a list of values in the hash for the deleted keys. In scalar context it returns the value for the last key specified. gone but not forgotten, and she'll hand you the receipts on the way out π
π SEE ALSO π
Data::PerlData::Perl::Role::Collection::Hash
π§ AUTHOR π§
Toby Inkster <tobyink@cpan.org>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
okay that's the whole page, no notes, ate and left no crumbs π this was Data::...oseLike(3pm) as documented for perl v5.36.0, dated 2022-10-16, from the User Contributed Perl Documentation. stan a well-documented hash wrapper. periodt. πβ¨
π¦ where this page comes from
- ubuntu noble: libmoox-handlesvia-perl 0.001009-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoox-handlesvia-perl 0.001009-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoox-handlesvia-perl 0.001009-2 Β· 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