File Coverage

blib/lib/List/Utils/MoveElement.pm
Criterion Covered Total %
statement 43 44 97.7
branch 1 2 50.0
condition n/a
subroutine 7 7 100.0
pod n/a
total 51 53 96.2


line stmt bran cond sub pod time code
1             package List::Utils::MoveElement;
2              
3 1     1   1058 use 5.008;
  1         4  
4 1     1   5 use strict;
  1         2  
  1         20  
5 1     1   6 use warnings;
  1         1  
  1         35  
6 1     1   7 use Exporter;
  1         2  
  1         195  
7              
8             BEGIN {
9 1     1   3 our $VERSION = qw/0.02/;
10 1         17 our @ISA = qw/Exporter/;
11 1         4 our @EXPORT = qw/move_element_left move_element_right move_element_to_beginning move_element_to_end/;
12 1         2 our $xs_loaded;
13              
14             # Load XS version if available, otherwise load PP version
15 1         2 local $@;
16             eval {
17 1         5 require XSLoader;
18 1         2083 XSLoader::load('List::Utils::MoveElement', $VERSION);
19 0         0 $xs_loaded = 1;
20 1 50       2 } or do {
21 1         8 require List::Utils::MoveElement::PP;
22 1     1   7 no strict 'refs';
  1         8  
  1         102  
23 1         2 *left = \&{'List::Utils::MoveElement::PP::left'};
  1         5  
24 1         2 *right = \&{'List::Utils::MoveElement::PP::right'};
  1         3  
25 1         2 *to_beginning = \&{'List::Utils::MoveElement::PP::to_beginning'};
  1         3  
26 1         2 *to_end = \&{'List::Utils::MoveElement::PP::to_end'};
  1         13  
27             };
28              
29             # Alias long names to short names
30             {
31 1     1   7 no strict 'refs';
  1         2  
  1         95  
  1         3  
32 1         2 *move_element_left = \&{__PACKAGE__ . '::left'};
  1         2  
33 1         3 *move_element_right = \&{__PACKAGE__ . '::right'};
  1         2  
34 1         2 *move_element_to_beginning = \&{__PACKAGE__ . '::to_beginning'};
  1         2  
35 1         2 *move_element_to_end = \&{__PACKAGE__ . '::to_end'};
  1         36  
36             }
37             }
38              
39             1;
40              
41             __END__