logo
Free, Micro AI Code Reviews That Run on Git Commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt

Data::Perl::Collection::Array::MooseLike - Collection::Array subclass that simulates Moose's native

Author

       Toby Inkster <tobyink@cpan.org>

Description

       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.

Name

       Data::Perl::Collection::Array::MooseLike - Collection::Array subclass that simulates Moose's native
       traits.

See Also

       •   Data::Perl

       •   Data::Perl::Role::Collection::Array

Synopsis

         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

See Also