CSAF::Util::List(3pm)

πŸ“¦
version 0.26 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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 for to_array. same energy, different name πŸ’–
  • add β€” alias for item. 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>

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