line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Maplat::Array::Unique; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
302549
|
use 5.020; |
|
3
|
|
|
|
|
14
|
|
4
|
3
|
|
|
3
|
|
18
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
72
|
|
5
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
90
|
|
6
|
3
|
|
|
3
|
|
2268
|
use diagnostics; |
|
3
|
|
|
|
|
942293
|
|
|
3
|
|
|
|
|
33
|
|
7
|
3
|
|
|
3
|
|
1253
|
use mro 'c3'; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
32
|
|
8
|
3
|
|
|
3
|
|
2627
|
use English; |
|
3
|
|
|
|
|
15054
|
|
|
3
|
|
|
|
|
28
|
|
9
|
|
|
|
|
|
|
our $VERSION = 2.7; # Based on Maplat version this was tested against |
10
|
3
|
|
|
3
|
|
2072
|
use Carp; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
775
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
require Exporter; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our @EXPORT = qw(unique); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub unique { |
19
|
6
|
|
|
6
|
1
|
2483
|
my ($dataset) = @_; |
20
|
|
|
|
|
|
|
|
21
|
6
|
100
|
|
|
|
25
|
if(!defined($dataset)) { |
22
|
1
|
|
|
|
|
254
|
croak('array reference is not defined in unique()'); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
5
|
100
|
|
|
|
27
|
if(ref($dataset) ne 'ARRAY') { |
26
|
3
|
|
|
|
|
508
|
croak('dataset is not an array reference in unique()'); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
6
|
my %temp; |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
|
|
7
|
foreach my $key (@{$dataset}) { |
|
2
|
|
|
|
|
9
|
|
32
|
14
|
|
|
|
|
49
|
$temp{$key} = 1; |
33
|
|
|
|
|
|
|
} |
34
|
2
|
|
|
|
|
24
|
@{$dataset} = sort keys %temp; |
|
2
|
|
|
|
|
19
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |