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

Data::Perl::Collection::Array::MooseLike3pm

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

Usage

  use Data::Perl::Collection::Array::MooseLike;
  my $array = Data::Perl::Collection::Array::MooseLike->new(qw/a b c d/);
  my $scalar_context = $array->splice(0, 2); # removes and returns b
  my @list_context = $array->splice(0, 2); # returns and removes (b, c)

Version

version 0.001009

Overview

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

Differences in functionality

splice($args, ...)

Just like Perl's builtin splice. In scalar context, this returns the last element removed, or undef if no elements were removed. In list context, this returns all the elements removed from the array.

This method requires at least one argument.

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.