line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::DOM::Array; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = '0.16'; |
4
|
|
|
|
|
|
|
|
5
|
25
|
|
|
25
|
|
134
|
use warnings; |
|
25
|
|
|
|
|
46
|
|
|
25
|
|
|
|
|
742
|
|
6
|
25
|
|
|
25
|
|
127
|
use strict; |
|
25
|
|
|
|
|
67
|
|
|
25
|
|
|
|
|
2786
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
204
|
|
|
204
|
0
|
2250
|
bless[@_[1..$#_]], shift; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
18
|
|
|
18
|
1
|
481
|
sub length { scalar @{+shift} } |
|
18
|
|
|
|
|
84
|
|
13
|
|
|
|
|
|
|
sub item { |
14
|
6
|
|
|
6
|
1
|
1255
|
my $self = shift; |
15
|
6
|
50
|
|
|
|
45
|
$_[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.16 |
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 |