Data::Perl::Collection::Hash::MooseLike(3pm)

Data::Perl::Collection::Hash::MooseLike3pm

Collection::hash subclass that simulates moose's native traits.

Usage

  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')

Version

version 0.001009

Overview

This class provides a wrapper and methods for interacting with a hash. All methods are written to emulate/match existing behavior that exists with Moose's native traits.

Differences in functionality

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.

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.

This method requires at least two arguments, and expects an even number of arguments.

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.

Releases

7 releases since Debian 8 (Jessie); the text changed 5 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12–13
  6. Arch

Author

Toby Inkster <[email protected]>

From perl-moox-handlesvia 0.001009-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.