line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::DOM::Array; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = '0.17'; |
4
|
|
|
|
|
|
|
|
5
|
25
|
|
|
25
|
|
136
|
use warnings; |
|
25
|
|
|
|
|
40
|
|
|
25
|
|
|
|
|
702
|
|
6
|
25
|
|
|
25
|
|
98
|
use strict; |
|
25
|
|
|
|
|
54
|
|
|
25
|
|
|
|
|
2383
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
204
|
|
|
204
|
0
|
1540
|
bless[@_[1..$#_]], shift; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
18
|
|
|
18
|
1
|
515
|
sub length { scalar @{+shift} } |
|
18
|
|
|
|
|
68
|
|
13
|
|
|
|
|
|
|
sub item { |
14
|
6
|
|
|
6
|
1
|
1269
|
my $self = shift; |
15
|
6
|
50
|
|
|
|
32
|
$_[0] > $#$self ? () : $self->[$_[0]] |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
!()__END__()! |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
CSS::DOM::Array - Array class for CSS::DOM |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 VERSION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Version 0.17 |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
use CSS::DOM::Array; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$array = new CSS::DOM::Array 'this', 'that'; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
@$array; |
35
|
|
|
|
|
|
|
$array->[0]; |
36
|
|
|
|
|
|
|
# etc. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$array->length; |
39
|
|
|
|
|
|
|
$array->item(0); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This module serves as a base class for array-like objects required by |
44
|
|
|
|
|
|
|
L. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
A CSS::DOM::Array object is simply a blessed array reference. You can use |
47
|
|
|
|
|
|
|
it as an array directly, or use the methods below. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 METHODS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 Constructor |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$array = new CSS::DOM::Array; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Creates a new blessed array. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 Object Methods |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over 4 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item length |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Returns the length of the array. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item item ( $index) |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Returns the array element at the given C<$index>. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=back |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SEE ALSO |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
L |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
L |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
L |