1Data::Perl::Collection:U:sHearshC:o:nMtoroisbeuLtieDkdaet(Pa3e:)r:lPeDrolc:u:mCeonltlaetcitoinon::Hash::MooseLike(3)
2
3
4
6 Data::Perl::Collection::Hash::MooseLike - Collection::Hash subclass
7 that simulates Moose's native traits.
8
10 version 0.001008
11
13 use Data::Perl::Collection::Hash::MooseLike;
14
15 my $hash = Data::Perl::Collection::Hash::MooseLike->new(a => 1, b => 2);
16
17 $hash->values; # (1, 2)
18
19 $hash->set('foo', 'bar'); # (a => 1, b => 2, foo => 'bar')
20
22 This class provides a wrapper and methods for interacting with a hash.
23 All methods are written to emulate/match existing behavior that exists
24 with Moose's native traits.
25
27 get($key, $key, ...)
28 Returns values from the hash.
29
30 In list context it returns a list of values in the hash for the
31 given keys. In scalar context it returns the value for the last key
32 specified.
33
34 set($key, $value, ...)
35 Sets the elements in the hash to the given values. It returns the
36 new values set for each key, in the same order as the keys passed
37 to the method.
38
39 This method requires at least two arguments, and expects an even
40 number of arguments.
41
42 delete($key, $key, ...)
43 Removes the elements with the given keys.
44
45 In list context it returns a list of values in the hash for the
46 deleted keys. In scalar context it returns the value for the last
47 key specified.
48
50 · Data::Perl
51
52 · Data::Perl::Role::Collection::Hash
53
55 Matthew Phillips <mattp@cpan.org>
56
58 This software is copyright (c) 2015 by Matthew Phillips
59 <mattp@cpan.org>.
60
61 This is free software; you can redistribute it and/or modify it under
62 the same terms as the Perl 5 programming language system itself.
63
64
65
66perl v5.30.0 201D9a-t0a7:-:2P6erl::Collection::Hash::MooseLike(3)