line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::DOM::Array; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = '0.15'; |
4
|
|
|
|
|
|
|
|
5
|
25
|
|
|
25
|
|
178
|
use warnings; |
|
25
|
|
|
|
|
49
|
|
|
25
|
|
|
|
|
825
|
|
6
|
25
|
|
|
25
|
|
138
|
use strict; |
|
25
|
|
|
|
|
71
|
|
|
25
|
|
|
|
|
3166
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
204
|
|
|
204
|
0
|
3017
|
bless[@_[1..$#_]], shift; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
18
|
|
|
18
|
1
|
778
|
sub length { scalar @{+shift} } |
|
18
|
|
|
|
|
111
|
|
13
|
|
|
|
|
|
|
sub item { |
14
|
6
|
|
|
6
|
1
|
1786
|
my $self = shift; |
15
|
6
|
50
|
|
|
|
126
|
$_[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.15 |
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<CSS::DOM>. |
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<CSS::DOM> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L<CSS::DOM::RuleList> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
L<CSS::DOM::StyleSheetList> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
L<CSS::DOM::MediaList> |