File Coverage

blib/lib/Acme/CPANModules/RemovingElementsFromArray.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Acme::CPANModules::RemovingElementsFromArray;
2              
3 2     2   267690 use strict;
  2         5  
  2         89  
4 2     2   1101 use Acme::CPANModulesUtil::Misc;
  2         1169  
  2         337  
5              
6             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
7             our $DATE = '2023-09-30'; # DATE
8             our $DIST = 'Acme-CPANModules-RemovingElementsFromArray'; # DIST
9             our $VERSION = '0.003'; # VERSION
10              
11             our $LIST = {
12             summary => 'List of modules to help remove elements from array',
13             description => <<'MARKDOWN',
14              
15             Perl provides several ways to remove elements from an array. `shift` removes one
16             element from the beginning, `pop` removes one element from the end, and `splice`
17             removes a slice of array (and insert another list in its place). There's also
18             `grep`, which lets you filter a list with a user-supplied code. While this does
19             not directly modify an array, you can simply assign the new filtered values to
20             the array. And I might just as well mention array slice (`@ary[1,3,4]` or
21             `@ary[1..4]`) which allows you to pick the range of elements you want by their
22             indices.
23              
24             In addition to the above, there are also other modules which provide some
25             convenience.
26              
27             **Removing duplicate items**
28              
29             provides C (as well as C, C, C)
30             to remove duplicate items from a list. There's also
31             providing C, C, C, and C, which return the
32             duplicates instead.
33              
34             **Removing overlapped items**
35              
36             lets you find overlapping items from a series of
37             arrays and optionally remove them.
38              
39             **Variations of `grep`**
40              
41             Some modules offer variations of `grep`. For example,
42             keeps the elements that are filtered out instead those that match the grep
43             expression. offers `sglice`, which removes elements that
44             matches user-supplied code, except that `sglice` (like `splice`) allows you to
45             specify a limit to the number of elements to remove.
46              
47             **mapslice**
48              
49             offers `mapsplice`, which removes a slice of array
50             but lets you replace each element with new elements using Perl code.
51              
52             MARKDOWN
53             'x.app.cpanmodules.show_entries' => 0,
54             };
55              
56             Acme::CPANModulesUtil::Misc::populate_entries_from_module_links_in_description;
57              
58             1;
59             # ABSTRACT: List of modules to help remove elements from array
60              
61             __END__