blib/lib/List/MoreUtils/XS.pm

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 96.8% 31 / 32 CC 1 SCAR 0.0
CC
1
Cov
96%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« XS.xs ↑ Summary
1 package List::MoreUtils::XS;
2  
3 61 ▶use 5.008_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 61 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 61 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 61 ▶use base ('Exporter');
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 61 ▶use vars qw{$VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS};
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 61 $VERSION = '0.430';
11  
12 61 @EXPORT = ();
13 61 @EXPORT_OK = qw(any all none notall one
14 any_u all_u none_u notall_u one_u
15 reduce_u reduce_0 reduce_1
16 true false
17 insert_after insert_after_string
18 apply indexes slide
19 after after_incl before before_incl
20 firstidx lastidx onlyidx
21 firstval lastval onlyval
22 firstres lastres onlyres
23 singleton duplicates frequency occurrences mode
24 each_array each_arrayref
25 pairwise natatime slideatatime
26 arrayify mesh zip6 uniq listcmp
27 samples minmax minmaxstr part
28 bsearch bsearchidx binsert bremove lower_bound upper_bound equal_range
29 qsort);
30 61 %EXPORT_TAGS = (all => \@EXPORT_OK);
31  
32 # Load the XS at compile-time so that redefinition warnings will be
33 # thrown correctly if the XS versions of part or indexes loaded
34  
35 # PERL_DL_NONLAZY must be false, or any errors in loading will just
36 # cause the perl code to be tested
37 61 ▶local $ENV{PERL_DL_NONLAZY} = 0 if $ENV{PERL_DL_NONLAZY};
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"PERL_DL_NONLAZY"} 61 0 61
38  
39 61 ▶use XSLoader ();
Subroutine BEGIN: called CC=1 SCAR=0.0
40 61 XSLoader::load("List::MoreUtils::XS", "$VERSION");
41  
42 =pod
43  
44 =head1 NAME
45  
46 List::MoreUtils::XS - Provide compiled List::MoreUtils functions
47  
48 =head1 SYNOPSIS
49  
50 use List::MoreUtils::XS (); # doesn't export anything
51 use List::MoreUtils ':all'; # required to import functions
52  
53 my @procs = get_process_stats->fetchall_array;
54 # sort by ppid, then pid
55 qsort { $a->[3] <=> $b->[3] or $a->[2] <=> $b->[2] } @procs;
56 while( @procs ) {
57 my $proc = shift @procs;
58 my @children = equal_range { $_->[3] <=> $proc->[2] } @procs;
59 }
60  
61 my @left = qw(this is a test);
62 my @right = qw(this is also a test);
63 my %rlinfo = listcmp @left, @right;
64  
65 # on unsorted
66 my $i = firstidx { $_ eq 'yeah' } @foo;
67 # on sorted - always first, but might not be 'yeah'
68 my $j = lower_bound { $_ cmp 'yeah' } @bar;
69 # on sorted - any of occurrences, is surely 'yeah'
70 my $k = bsearchidx { $_ cmp 'yeah' } @bar;
71  
72 =head1 DESCRIPTION
73  
74 List::MoreUtils::XS is a backend for List::MoreUtils. Even if it's possible
75 (because of user wishes) to have it practically independent from
76 L<List::MoreUtils>, it technically depend on C<List::MoreUtils>. Since it's
77 only a backend, the API is not public and can change without any warning.
78  
79 =head1 SEE ALSO
80  
81 L<List::Util>, L<List::AllUtils>
82  
83 =head1 AUTHOR
84  
85 Jens Rehsack E<lt>rehsack AT cpan.orgE<gt>
86  
87 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
88  
89 Tassilo von Parseval E<lt>tassilo.von.parseval@rwth-aachen.deE<gt>
90  
91 =head1 COPYRIGHT AND LICENSE
92  
93 Some parts copyright 2011 Aaron Crane.
94  
95 Copyright 2004 - 2010 by Tassilo von Parseval
96  
97 Copyright 2013 - 2017 by Jens Rehsack
98  
99 All code added with 0.417 or later is licensed under the Apache License,
100 Version 2.0 (the "License"); you may not use this file except in compliance
101 with the License. You may obtain a copy of the License at
102  
103 http://www.apache.org/licenses/LICENSE-2.0
104  
105 Unless required by applicable law or agreed to in writing, software
106 distributed under the License is distributed on an "AS IS" BASIS,
107 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
108 See the License for the specific language governing permissions and
109 limitations under the License.
110  
111 All code until 0.416 is licensed under the same terms as Perl itself,
112 either Perl version 5.8.4 or, at your option, any later version of
113 Perl 5 you may have available.
114  
115 =cut
116  
117 61 1;
« XS.xs ↑ Summary