1Data::Perl::Collection:U:sAerrraCyo:n:tMroiobsuetDLeaidtkaeP:(e:3rP)lerDlo:c:uCmoelnlteacttiioonn::Array::MooseLike(3)
2
3
4
6 Data::Perl::Collection::Array::MooseLike - Collection::Array subclass
7 that simulates Moose's native traits.
8
10 version 0.001008
11
13 use Data::Perl::Collection::Array::MooseLike;
14
15 my $array = Data::Perl::Collection::Array::MooseLike->new(qw/a b c d/);
16
17 my $scalar_context = $array->splice(0, 2); # removes and returns b
18
19 my @list_context = $array->splice(0, 2); # returns and removes (b, c)
20
22 This class provides a wrapper and methods for interacting with an
23 array. All methods are written to emulate/match existing behavior that
24 exists with Moose's native traits.
25
27 splice($args, ...)
28 Just like Perl's builtin splice. In scalar context, this returns
29 the last element removed, or undef if no elements were removed. In
30 list context, this returns all the elements removed from the array.
31
32 This method requires at least one argument.
33
35 · Data::Perl
36
37 · Data::Perl::Role::Collection::Array
38
40 Matthew Phillips <mattp@cpan.org>
41
43 This software is copyright (c) 2015 by Matthew Phillips
44 <mattp@cpan.org>.
45
46 This is free software; you can redistribute it and/or modify it under
47 the same terms as the Perl 5 programming language system itself.
48
49
50
51perl v5.28.0 20D1a5t-a0:3:-P3e1rl::Collection::Array::MooseLike(3)