File Coverage

blib/lib/List/MoreUtils/XS.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 23 23 100.0


line stmt bran cond sub pod time code
1             package List::MoreUtils::XS;
2              
3 61     61   111312 use 5.008_001;
  61         613  
4 61     61   368 use strict;
  61         145  
  61         2310  
5 61     61   390 use warnings;
  61         133  
  61         2079  
6 61     61   362 use base ('Exporter');
  61         143  
  61         9118  
7              
8 61     61   432 use vars qw{$VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS};
  61         110  
  61         12082  
9              
10             $VERSION = '0.429_001';
11              
12             @EXPORT = ();
13             @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             %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             local $ENV{PERL_DL_NONLAZY} = 0 if $ENV{PERL_DL_NONLAZY};
38              
39 61     61   462 use XSLoader ();
  61         174  
  61         4141  
40             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, it technically depend on C. 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, L
82              
83             =head1 AUTHOR
84              
85             Jens Rehsack Erehsack AT cpan.orgE
86              
87             Adam Kennedy Eadamk@cpan.orgE
88              
89             Tassilo von Parseval Etassilo.von.parseval@rwth-aachen.deE
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             1;