Acme-CPANModules-RemovingElementsFromArray
view release on metacpan or search on metacpan
lib/Acme/CPANModules/RemovingItemsFromList.pm view on Meta::CPAN
## no critic: TestingAndDebugging::RequireUseStrict
package Acme::CPANModules::RemovingItemsFromList;
use alias::module 'Acme::CPANModules::RemovingElementsFromArray';
1;
# ABSTRACT: List of modules to remove items from list (alias for Acme::CPANModules::RemovingElementsFromArray)
__END__
=pod
=encoding UTF-8
=head1 NAME
Acme::CPANModules::RemovingItemsFromList - List of modules to remove items from list (alias for Acme::CPANModules::RemovingElementsFromArray)
=head1 VERSION
This document describes version 0.003 of Acme::CPANModules::RemovingItemsFromList (from Perl distribution Acme-CPANModules-RemovingElementsFromArray), released on 2023-09-30.
=head1 DESCRIPTION
Perl provides several ways to remove elements from an array. C<shift> removes one
element from the beginning, C<pop> removes one element from the end, and C<splice>
removes a slice of array (and insert another list in its place). There's also
C<grep>, which lets you filter a list with a user-supplied code. While this does
not directly modify an array, you can simply assign the new filtered values to
the array. And I might just as well mention array slice (C<@ary[1,3,4]> or
C<@ary[1..4]>) which allows you to pick the range of elements you want by their
indices.
In addition to the above, there are also other modules which provide some
convenience.
B<Removing duplicate items>
L<List::Util> provides C<uniq> (as well as C<uniqnum>, C<uniqint>, C<uniqstr>)
to remove duplicate items from a list. There's also L<List::Util::Uniq>
providing C<dupe>, C<dupenum>, C<dupeint>, and C<dupestr>, which return the
duplicates instead.
B<Removing overlapped items>
L<Array::OverlapFinder> lets you find overlapping items from a series of
arrays and optionally remove them.
B<< Variations of C<grep> >>
Some modules offer variations of C<grep>. For example, L<Array::KeepGrepped>
keeps the elements that are filtered out instead those that match the grep
expression. L<List::Util::sglice> offers C<sglice>, which removes elements that
matches user-supplied code, except that C<sglice> (like C<splice>) allows you to
specify a limit to the number of elements to remove.
B<mapslice>
L<List::Util::mapsplice> offers C<mapsplice>, which removes a slice of array
but lets you replace each element with new elements using Perl code.
=head1 ACME::CPANMODULES ENTRIES
=over
=item L<List::Util>
Author: L<PEVANS|https://metacpan.org/author/PEVANS>
=item L<List::Util::Uniq>
Author: L<PERLANCAR|https://metacpan.org/author/PERLANCAR>
( run in 0.400 second using v1.01-cache-2.11-cpan-39bf76dae61 )