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::Perl
  • Data::Perl::Role::Collection::Hash

🧚 AUTHOR 🧚

Toby Inkster <tobyink@cpan.org>


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