line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Array::Merge::Unique; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
62158
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
18
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
26
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
321
|
use Import::Export; |
|
1
|
|
|
|
|
517
|
|
|
1
|
|
|
|
|
5
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
37
|
use base qw/Import::Export/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
181
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our %EX = ( |
13
|
|
|
|
|
|
|
unique_array => [qw/all/] |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub unique_array { |
17
|
0
|
|
|
0
|
1
|
|
my (@dataset, %u); |
18
|
0
|
0
|
0
|
|
|
|
@dataset = grep { !$u{$_} && do { $u{$_} = 1 } && $_ } aoaoaoa(@_); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
return wantarray ? @dataset : \@dataset; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub aoaoaoa { |
23
|
0
|
0
|
|
0
|
0
|
|
return map { ref $_ eq 'ARRAY' ? aoaoaoa(@{ $_ }) : $_ } @_; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Array::Merge::Unique - Merge those arrays uniquely |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 VERSION |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Version 0.02 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SYNOPSIS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Quick summary of what the module does. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
use Array::Merge::Unique qw/unique_array/; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $arrayref = unique_array([qw/one two three/], qw/one two/); |
45
|
|
|
|
|
|
|
my @array = unique_array([qw/one two three/], qw/one two/); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 EXPORT |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 unique_array |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHOR |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Robert Acock, C<< >> |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 BUGS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
58
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
59
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SUPPORT |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
perldoc Array::Merge::Unique |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
You can also look for information at: |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=over 4 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
L |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
L |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * CPAN Ratings |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * Search CPAN |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=back |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Copyright 2017 Robert Acock. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
102
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
103
|
|
|
|
|
|
|
copy of the full license at: |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
L |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Any use, modification, and distribution of the Standard or Modified |
108
|
|
|
|
|
|
|
Versions is governed by this Artistic License. By using, modifying or |
109
|
|
|
|
|
|
|
distributing the Package, you accept this license. Do not use, modify, |
110
|
|
|
|
|
|
|
or distribute the Package, if you do not accept this license. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
If your Modified Version has been derived from a Modified Version made |
113
|
|
|
|
|
|
|
by someone other than you, you are nevertheless required to ensure that |
114
|
|
|
|
|
|
|
your Modified Version complies with the requirements of this license. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This license does not grant you the right to use any trademark, service |
117
|
|
|
|
|
|
|
mark, tradename, or logo of the Copyright Holder. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This license includes the non-exclusive, worldwide, free-of-charge |
120
|
|
|
|
|
|
|
patent license to make, have made, use, offer to sell, sell, import and |
121
|
|
|
|
|
|
|
otherwise transfer the Package with respect to any patent claims |
122
|
|
|
|
|
|
|
licensable by the Copyright Holder that are necessarily infringed by the |
123
|
|
|
|
|
|
|
Package. If you institute patent litigation (including a cross-claim or |
124
|
|
|
|
|
|
|
counterclaim) against any party alleging that the Package constitutes |
125
|
|
|
|
|
|
|
direct or contributory patent infringement, then this Artistic License |
126
|
|
|
|
|
|
|
to you shall terminate on the date that such litigation is filed. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER |
129
|
|
|
|
|
|
|
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. |
130
|
|
|
|
|
|
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
131
|
|
|
|
|
|
|
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY |
132
|
|
|
|
|
|
|
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR |
133
|
|
|
|
|
|
|
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR |
134
|
|
|
|
|
|
|
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, |
135
|
|
|
|
|
|
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=cut |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
1; # End of Array::Merge::Unique |