line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Array Object Role for Perl 5 |
2
|
|
|
|
|
|
|
package Data::Object::Role::Array; |
3
|
|
|
|
|
|
|
|
4
|
89
|
|
|
89
|
|
644561
|
use 5.010; |
|
89
|
|
|
|
|
335
|
|
5
|
89
|
|
|
89
|
|
31863
|
use Data::Object::Role; |
|
89
|
|
|
|
|
208
|
|
|
89
|
|
|
|
|
763
|
|
6
|
|
|
|
|
|
|
|
7
|
89
|
|
|
89
|
|
26252
|
use Data::Object 'codify'; |
|
89
|
|
|
|
|
180
|
|
|
89
|
|
|
|
|
4221
|
|
8
|
89
|
|
|
89
|
|
432
|
use Scalar::Util 'looks_like_number'; |
|
89
|
|
|
|
|
201
|
|
|
89
|
|
|
|
|
205861
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
map with($_), our @ROLES = qw( |
11
|
|
|
|
|
|
|
Data::Object::Role::Defined |
12
|
|
|
|
|
|
|
Data::Object::Role::Collection |
13
|
|
|
|
|
|
|
Data::Object::Role::Detract |
14
|
|
|
|
|
|
|
Data::Object::Role::Indexed |
15
|
|
|
|
|
|
|
Data::Object::Role::List |
16
|
|
|
|
|
|
|
Data::Object::Role::Output |
17
|
|
|
|
|
|
|
Data::Object::Role::Ref |
18
|
|
|
|
|
|
|
Data::Object::Role::Values |
19
|
|
|
|
|
|
|
Data::Object::Role::Type |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our $VERSION = '0.42'; # VERSION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub all { |
25
|
2
|
|
|
2
|
0
|
6
|
my ($array, $code, @arguments) = @_; |
26
|
|
|
|
|
|
|
|
27
|
2
|
100
|
|
|
|
11
|
$code = codify $code if !ref $code; |
28
|
2
|
|
|
|
|
11
|
my $found = CORE::grep { $code->($_, @arguments) } @$array; |
|
8
|
|
|
|
|
131
|
|
29
|
|
|
|
|
|
|
|
30
|
2
|
50
|
|
|
|
22
|
return $found == @$array ? 1 : 0; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub any { |
34
|
2
|
|
|
2
|
0
|
7
|
my ($array, $code, @arguments) = @_; |
35
|
|
|
|
|
|
|
|
36
|
2
|
100
|
|
|
|
14
|
$code = codify $code if !ref $code; |
37
|
2
|
|
|
|
|
15
|
my $found = CORE::grep { $code->($_, @arguments) } @$array; |
|
8
|
|
|
|
|
202
|
|
38
|
|
|
|
|
|
|
|
39
|
2
|
50
|
|
|
|
26
|
return $found ? 1 : 0; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub clear { |
43
|
1
|
|
|
1
|
0
|
7
|
goto ∅ |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub count { |
47
|
1
|
|
|
1
|
0
|
7
|
goto &length; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub defined { |
51
|
2
|
|
|
2
|
0
|
4
|
my ($array, $index) = @_; |
52
|
2
|
|
|
|
|
14
|
return CORE::defined $array->[$index]; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub delete { |
56
|
1
|
|
|
1
|
0
|
2
|
my ($array, $index) = @_; |
57
|
1
|
|
|
|
|
8
|
return CORE::delete $array->[$index]; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub each { |
61
|
2
|
|
|
2
|
0
|
5
|
my ($array, $code, @arguments) = @_; |
62
|
|
|
|
|
|
|
|
63
|
2
|
|
|
|
|
4
|
my $i=0; |
64
|
2
|
100
|
|
|
|
10
|
$code = codify $code if !ref $code; |
65
|
2
|
|
|
|
|
13
|
foreach my $value (@$array) { |
66
|
14
|
|
|
|
|
170
|
$code->($i, $value, @arguments); $i++; |
|
14
|
|
|
|
|
45
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
2
|
|
|
|
|
22
|
return $array; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub each_key { |
73
|
1
|
|
|
1
|
0
|
2
|
my ($array, $code, @arguments) = @_; |
74
|
|
|
|
|
|
|
|
75
|
1
|
50
|
|
|
|
4
|
$code = codify $code if !ref $code; |
76
|
1
|
|
|
|
|
3
|
$code->($_, @arguments) for (0..$#{$array}); |
|
1
|
|
|
|
|
12
|
|
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
28
|
return $array; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub each_n_values { |
82
|
1
|
|
|
1
|
0
|
3
|
my ($array, $number, $code, @arguments) = @_; |
83
|
|
|
|
|
|
|
|
84
|
1
|
|
|
|
|
10
|
my @values = @$array; |
85
|
1
|
50
|
|
|
|
7
|
$code = codify $code if !ref $code; |
86
|
1
|
|
|
|
|
9
|
$code->(splice(@values, 0, $number), @arguments) while @values; |
87
|
|
|
|
|
|
|
|
88
|
1
|
|
|
|
|
39
|
return $array; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub each_value { |
92
|
1
|
|
|
1
|
0
|
2
|
my ($array, $code, @arguments) = @_; |
93
|
|
|
|
|
|
|
|
94
|
1
|
50
|
|
|
|
5
|
$code = codify $code if !ref $code; |
95
|
1
|
|
|
|
|
3
|
$code->($array->[$_], @arguments) for (0..$#{$array}); |
|
1
|
|
|
|
|
11
|
|
96
|
|
|
|
|
|
|
|
97
|
1
|
|
|
|
|
26
|
return $array; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub empty { |
101
|
2
|
|
|
2
|
0
|
5
|
my ($array) = @_; |
102
|
2
|
|
|
|
|
18
|
$#$array = -1; |
103
|
2
|
|
|
|
|
9
|
return $array; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub exists { |
107
|
1
|
|
|
1
|
0
|
3
|
my ($array, $index) = @_; |
108
|
1
|
|
|
|
|
9
|
return $index <= $#{$array}; |
|
1
|
|
|
|
|
10
|
|
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub first { |
112
|
3
|
|
|
3
|
0
|
6
|
my ($array) = @_; |
113
|
3
|
|
|
|
|
13
|
return $array->[0]; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub get { |
117
|
1
|
|
|
1
|
0
|
3
|
my ($array, $index) = @_; |
118
|
1
|
|
|
|
|
7
|
return $array->[$index]; |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub grep { |
122
|
1
|
|
|
1
|
0
|
4
|
my ($array, $code, @arguments) = @_; |
123
|
1
|
50
|
|
|
|
5
|
$code = codify $code if !ref $code; |
124
|
1
|
|
|
|
|
7
|
return [CORE::grep { $code->($_, @arguments) } @$array]; |
|
5
|
|
|
|
|
16
|
|
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub hashify { |
128
|
2
|
|
|
2
|
0
|
4
|
my ($array, $code, @arguments) = @_; |
129
|
|
|
|
|
|
|
|
130
|
2
|
|
|
|
|
5
|
my $data = {}; |
131
|
2
|
50
|
50
|
|
|
14
|
$code = codify $code // 1 if !ref $code; |
132
|
2
|
|
|
|
|
10
|
for (CORE::grep { CORE::defined $_ } @$array) { |
|
10
|
|
|
|
|
19
|
|
133
|
10
|
|
|
|
|
201
|
$data->{$_} = $code->($_, @arguments); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
2
|
|
|
|
|
26
|
return $data; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub head { |
140
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
141
|
1
|
|
|
|
|
8
|
return $array->[0]; |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
sub iterator { |
145
|
1
|
|
|
1
|
0
|
3
|
my ($array) = @_; |
146
|
1
|
|
|
|
|
2
|
my $i=0; |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
return sub { |
149
|
6
|
100
|
|
6
|
|
10
|
return undef if $i > $#{$array}; |
|
6
|
|
|
|
|
20
|
|
150
|
5
|
|
|
|
|
15
|
return $array->[$i++]; |
151
|
|
|
|
|
|
|
} |
152
|
1
|
|
|
|
|
6
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub join { |
155
|
1
|
|
|
1
|
0
|
2
|
my ($array, $separator) = @_; |
156
|
1
|
|
50
|
|
|
13
|
return join $separator // '', @$array; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
sub keyed { |
160
|
1
|
|
|
1
|
0
|
4
|
my ($array, @keys) = @_; |
161
|
|
|
|
|
|
|
|
162
|
1
|
|
|
|
|
2
|
my $i=0; |
163
|
1
|
|
|
|
|
3
|
return { map { $_ => $array->[$i++] } @keys }; |
|
4
|
|
|
|
|
17
|
|
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
sub keys { |
167
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
168
|
1
|
|
|
|
|
3
|
return [0 .. $#{$array}]; |
|
1
|
|
|
|
|
9
|
|
169
|
|
|
|
|
|
|
} |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
sub last { |
172
|
1
|
|
|
1
|
0
|
3
|
my ($array) = @_; |
173
|
1
|
|
|
|
|
7
|
return $array->[-1]; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub length { |
177
|
3
|
|
|
3
|
0
|
8
|
my ($array) = @_; |
178
|
3
|
|
|
|
|
22
|
return scalar @$array; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub map { |
182
|
1
|
|
|
1
|
0
|
3
|
my ($array, $code, @arguments) = @_; |
183
|
1
|
50
|
|
|
|
4
|
$code = codify $code if !ref $code; |
184
|
1
|
|
|
|
|
6
|
return [map { $code->($_, @arguments) } @$array]; |
|
5
|
|
|
|
|
20
|
|
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
sub max { |
188
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
189
|
|
|
|
|
|
|
|
190
|
1
|
|
|
|
|
2
|
my $max; |
191
|
1
|
|
|
|
|
7
|
for my $val (@$array) { |
192
|
10
|
100
|
|
|
|
18
|
next if ref($val); |
193
|
8
|
100
|
|
|
|
14
|
next if ! CORE::defined($val); |
194
|
7
|
50
|
|
|
|
17
|
next if ! looks_like_number($val); |
195
|
7
|
|
66
|
|
|
13
|
$max //= $val; |
196
|
7
|
100
|
|
|
|
18
|
$max = $val if $val > $max; |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
|
199
|
1
|
|
|
|
|
4
|
return $max; |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
sub min { |
203
|
1
|
|
|
1
|
0
|
3
|
my ($array) = @_; |
204
|
|
|
|
|
|
|
|
205
|
1
|
|
|
|
|
1
|
my $min; |
206
|
1
|
|
|
|
|
7
|
for my $val (@$array) { |
207
|
5
|
50
|
|
|
|
9
|
next if ref($val); |
208
|
5
|
50
|
|
|
|
9
|
next if ! CORE::defined($val); |
209
|
5
|
50
|
|
|
|
13
|
next if ! looks_like_number($val); |
210
|
5
|
|
66
|
|
|
13
|
$min //= $val; |
211
|
5
|
50
|
|
|
|
11
|
$min = $val if $val < $min; |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
1
|
|
|
|
|
4
|
return $min; |
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub none { |
218
|
1
|
|
|
1
|
0
|
2
|
my ($array, $code, @arguments) = @_; |
219
|
1
|
50
|
|
|
|
5
|
$code = codify $code if !ref $code; |
220
|
1
|
|
|
|
|
5
|
my $found = CORE::grep { $code->($_, @arguments) } @$array; |
|
4
|
|
|
|
|
15
|
|
221
|
1
|
50
|
|
|
|
6
|
return $found ? 0 : 1; |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
sub nsort { |
225
|
1
|
|
|
1
|
0
|
3
|
my ($array) = @_; |
226
|
1
|
|
|
|
|
15
|
return [sort { $a <=> $b } @$array]; |
|
5
|
|
|
|
|
13
|
|
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
sub one { |
230
|
1
|
|
|
1
|
0
|
3
|
my ($array, $code, @arguments) = @_; |
231
|
1
|
50
|
|
|
|
4
|
$code = codify $code if !ref $code; |
232
|
1
|
|
|
|
|
6
|
my $found = CORE::grep { $code->($_, @arguments) } @$array; |
|
6
|
|
|
|
|
20
|
|
233
|
1
|
50
|
|
|
|
7
|
return $found == 1 ? 1 : 0; |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
sub pairs { |
237
|
1
|
|
|
1
|
0
|
5
|
goto &pairs_array; |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
sub pairs_array { |
241
|
2
|
|
|
2
|
0
|
4
|
my ($array) = @_; my $i=0; |
|
2
|
|
|
|
|
5
|
|
242
|
2
|
|
|
|
|
21
|
return [map +[$i++, $_], @$array]; |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
sub pairs_hash { |
246
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; my $i=0; |
|
1
|
|
|
|
|
3
|
|
247
|
1
|
|
|
|
|
6
|
return {map {$i++ => $_} @$array}; |
|
5
|
|
|
|
|
13
|
|
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
sub part { |
251
|
1
|
|
|
1
|
0
|
3
|
my ($array, $code, @arguments) = @_; |
252
|
1
|
50
|
|
|
|
4
|
$code = codify $code if !ref $code; |
253
|
|
|
|
|
|
|
|
254
|
1
|
|
|
|
|
2
|
my $result = [[],[]]; |
255
|
1
|
|
|
|
|
7
|
foreach my $value (@$array) { |
256
|
10
|
100
|
|
|
|
18
|
my $slot = $code->($value, @arguments) ? |
257
|
|
|
|
|
|
|
$$result[0] : $$result[1] |
258
|
|
|
|
|
|
|
; |
259
|
10
|
|
|
|
|
36
|
push @$slot, $value; |
260
|
|
|
|
|
|
|
} |
261
|
|
|
|
|
|
|
|
262
|
1
|
|
|
|
|
6
|
return $result; |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
sub pop { |
266
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
267
|
1
|
|
|
|
|
9
|
return pop @$array; |
268
|
|
|
|
|
|
|
} |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
sub push { |
271
|
15
|
|
|
15
|
0
|
28
|
my ($array, @arguments) = @_; |
272
|
15
|
|
|
|
|
34
|
push @$array, @arguments; |
273
|
15
|
|
|
|
|
43
|
return $array; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
sub random { |
277
|
50
|
|
|
50
|
0
|
57
|
my ($array) = @_; |
278
|
50
|
|
|
|
|
58
|
return @$array[rand(1+$#{$array})]; |
|
50
|
|
|
|
|
207
|
|
279
|
|
|
|
|
|
|
} |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
sub reverse { |
282
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
283
|
1
|
|
|
|
|
8
|
return [reverse @$array]; |
284
|
|
|
|
|
|
|
} |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub rotate { |
287
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
288
|
1
|
|
|
|
|
6
|
CORE::push @$array, CORE::shift @$array; |
289
|
1
|
|
|
|
|
4
|
return $array; |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
sub rnsort { |
293
|
1
|
|
|
1
|
0
|
3
|
my ($array) = @_; |
294
|
1
|
|
|
|
|
12
|
return [sort { $b <=> $a } @$array]; |
|
8
|
|
|
|
|
16
|
|
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
sub rsort { |
298
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
299
|
1
|
|
|
|
|
13
|
return [sort { $b cmp $a } @$array]; |
|
4
|
|
|
|
|
13
|
|
300
|
|
|
|
|
|
|
} |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
sub set { |
303
|
1
|
|
|
1
|
0
|
2
|
my ($array, $index, $value) = @_; |
304
|
1
|
|
|
|
|
7
|
return $array->[$index] = $value; |
305
|
|
|
|
|
|
|
} |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
sub shift { |
308
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
309
|
1
|
|
|
|
|
7
|
return CORE::shift @$array; |
310
|
|
|
|
|
|
|
} |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
sub size { |
313
|
1
|
|
|
1
|
0
|
5
|
goto &length; |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
sub slice { |
317
|
1
|
|
|
1
|
0
|
3
|
my ($array, @arguments) = @_; |
318
|
1
|
|
|
|
|
9
|
return [@$array[@arguments]]; |
319
|
|
|
|
|
|
|
} |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
sub sort { |
322
|
2
|
|
|
2
|
0
|
4
|
my ($array) = @_; |
323
|
2
|
|
|
|
|
19
|
return [sort { $a cmp $b } @$array]; |
|
5
|
|
|
|
|
14
|
|
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
sub sum { |
327
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
328
|
|
|
|
|
|
|
|
329
|
1
|
|
|
|
|
2
|
my $sum = 0; |
330
|
1
|
|
|
|
|
8
|
for my $val (@$array) { |
331
|
5
|
50
|
|
|
|
10
|
next if ref($val); |
332
|
5
|
50
|
|
|
|
10
|
next if !CORE::defined($val); |
333
|
5
|
50
|
|
|
|
18
|
next if !looks_like_number($val); |
334
|
5
|
|
|
|
|
8
|
$sum += $val; |
335
|
|
|
|
|
|
|
} |
336
|
|
|
|
|
|
|
|
337
|
1
|
|
|
|
|
5
|
return $sum; |
338
|
|
|
|
|
|
|
} |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
sub tail { |
341
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; |
342
|
1
|
|
|
|
|
10
|
return [@$array[1 .. $#$array]]; |
343
|
|
|
|
|
|
|
} |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
sub unique { |
346
|
1
|
|
|
1
|
0
|
2
|
my ($array) = @_; my %seen; |
|
1
|
|
|
|
|
2
|
|
347
|
1
|
|
|
|
|
8
|
return [CORE::grep { not $seen{$_}++ } @$array]; |
|
7
|
|
|
|
|
19
|
|
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
sub unshift { |
351
|
1
|
|
|
1
|
0
|
3
|
my ($array, @arguments) = @_; |
352
|
1
|
|
|
|
|
7
|
CORE::unshift @$array, @arguments; |
353
|
1
|
|
|
|
|
2
|
return $array; |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
sub values { |
357
|
3
|
|
|
3
|
0
|
5
|
my ($array) = @_; |
358
|
3
|
|
|
|
|
32
|
return [@$array]; |
359
|
|
|
|
|
|
|
} |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
1; |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
__END__ |