CSAF::Util::List(3pm)
π CSAF::Util::List π
okay bestie, so this is CSAF::Util::List, a page from the User Contributed Perl Documentation, and it's literally the cutest little collection utility. Mojo-flavored, no cap. Let's get into it π«Ά
β¨ NAME β¨
CSAF::Util::List β a (Mojo like) collection utility π
πΈ SYNOPSIS πΈ
use CSAF::Util::List;
my $collection = CSAF::Util::List->new( qw[foo bar baz] );
π¦ DESCRIPTION π¦
CSAF::Util::List is a collection utility. That's the whole vibe. It holds your stuff, you do stuff with it. iconic behavior honestly β¨
π METHODS π
TO_JSONβ bestie this is just an alias forto_array. same energy, different name πaddβ alias foritem. yes, two names, one job, we love a flexible icon πeachβ run a callback on every single element in the collection. three whole ways to do it, pick your fighter:
foreach my $item ($c->each) {
[...]
}
my $collection = $c->each(sub {...});
$c->each(sub {
my ($value, $idx) = @_;
[...]
});
firstβ grab the very first element of the collection. main character of the list πgrepβ filter your items, get back the ones that pass:
my $filtered = $c->grep(sub { $_ eq 'foo' });
itemβ add a brand new item to the collection. works with a value or a callback:
$c->item('foo');
$c->item(sub {...});
itemsβ get the list of collection items. the whole squad, assembled πjoinβ smoosh your elements together:
$c->join(', ');
lastβ get the last element of the collection. the finale, the closing act π¬mapβ evaluate the callback and make a whole new collection out of it:
CSAF::Util::List->new(1,2,3)->map(sub { $_ * 2 });
newβ create a new collection. birth of a legend:
my $c = CSAF::Util::List->new( [foo bar baz] );
sizeβ the number of item elements. how many besties are in the group chat π’to_arrayβ return the collection array. plain, simple, slay π
πΌ SUPPORT πΌ
π Bugs / Feature Requests π
Please report any bugs or feature requests through the issue tracker at <https://github.com/giterlizzi/perl-CSAF/issues>. You will be notified automatically of any progress on your issue. fr fr, they'll keep you posted π
π¦ Source Code π¦
This is open source software. The code repository is available for public review and contribution under the terms of the license.
<https://github.com/giterlizzi/perl-CSAF>
git clone https://github.com/giterlizzi/perl-CSAF.git
π AUTHOR π
- Giuseppe Di Terlizzi <gdt@cpan.org>
π LICENSE AND COPYRIGHT π
This software is copyright (c) 2023-2025 by Giuseppe Di Terlizzi.
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 whole page bestie!! this beauty ships with perl v5.40.1 and is dated 2025-09-03 π go forth and collect ur items, ily, bye πβ¨π¦
π¦ where this page comes from
- ubuntu resolute: libcsaf-perl 0.26-1 Β· Artistic-2.0
- ubuntu stonking: libcsaf-perl 0.26-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms