Moose:...::Array(3pm)
π Moose::Autobox::Array β the Array role π
okay bestie, welcome to the Moose::Autobox::Array page, straight out of the User Contributed Perl Documentation section of your friendly neighbourhood man pages. It's the manual for Moose:...::Array(3pm), and yes we're doing this together, hand in hand, no cap. π«Ά
β¨ NAME β¨
Moose::Autobox::Array β the Array role. That's it, that's the name, she's iconic. π
πΈ VERSION πΈ
version 0.16 β this is the version we're talking about, don't come for her, she's doing her best. π
π¦ SYNOPSIS π¦
here's the vibe, copy-paste ready, character for character:
use Moose::Autobox;
[ 1..5 ]->isa('ARRAY'); # true
[ a..z ]->does('Moose::Autobox::Array'); # true
[ 0..2 ]->does('Moose::Autobox::List'); # true
print "Squares: " . [ 1 .. 10 ]->map(sub { $_ * $_ })->join(', ');
print [ 1, 'number' ]->sprintf('%d is the loneliest %s');
print ([ 1 .. 5 ]->any == 3) ? 'true' : 'false'; # prints 'true'
like look at her. array literals just doing methods. that's the whole flex. π₯
π DESCRIPTION π
This is a role to describe operations on the Array type. periodt. π
π METHODS π
the whole roster, no one left out, everyone eats:
"pop""push ($value)""shift""unshift ($value)""delete ($index)""sprintf ($format_string)""slice (@indices)""flatten""flatten_deep ($depth)""first""last"
π Indexed implementation π
the index-girlies, living their numbered truth:
"at ($index)""put ($index, $value)""exists ($index)""keys""values""kv""each""each_key""each_value""each_n_values ($n, $callback)"
π§ List implementation π§
and the list-besties, no indices required:
"head""tail""join (?$seperator)""length""map (\&block)""grep (\&block)"
β οΈ note, bestie, and this part is IMPORTANT: in both the above,$_is in scope within the code block, as well as being passed as$_[0]. As perCORE::mapandCORE::grep,$_is an alias to the list value, so can be used to modify the list, viz:
use Moose::Autobox;
my $foo = [1, 2, 3];
$foo->map( sub {$_++} );
print $foo->dump;
yields
$VAR1 = [
2,
3,
4
];
"reverse""sort (?\&block)"
β Junctions β
the choose-your-own-adventure section:
"all""any""none""one""meta""print""say"
π«Ά SUPPORT π«Ά
found a bug? she's not perfect, she's just a girl. Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Moose-Autobox> (or bug-Moose-Autobox@rt.cpan.org <mailto:bug-Moose-Autobox@rt.cpan.org>).
There is also a mailing list available for users of this distribution, at <http://lists.perl.org/list/moose.html>. π
There is also an irc channel available for users of this distribution, at "#moose" on "irc.perl.org" <irc://irc.perl.org/#moose>. come say hi, we don't bite, we just compile. π
π AUTHOR π
Stevan Little <stevan.little@iinteractive.com> β the main character who wrote this. respect. β¨
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2006 by Infinity Interactive, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. π
and that's the page bestie, we did it, ate and left no crumbs π
β¨. quick sign-off for the record: this whole thing comes to you from perl v5.34.0, dated 2022-06-15, filed under Moose:...::Array(3pm) in the User Contributed Perl Documentation. byeee, go write some arrays that know their own methods πΈπ¦
π¦ where this page comes from
- debian bookworm: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoose-autobox-perl 0.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms