line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package URI::tag; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10255
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
110
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
18
|
use base qw(URI); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1275
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub authority { |
9
|
10
|
|
|
10
|
1
|
32
|
my $self = shift; |
10
|
10
|
|
|
|
|
29
|
$self->_accessor('authority', @_); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub date { |
14
|
10
|
|
|
10
|
0
|
14
|
my $self = shift; |
15
|
10
|
|
|
|
|
24
|
$self->_accessor('date', @_); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub specific { |
19
|
10
|
|
|
10
|
0
|
19
|
my $self = shift; |
20
|
10
|
|
|
|
|
24
|
$self->_accessor('specific', @_); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _accessor { |
24
|
30
|
|
|
30
|
|
36
|
my $self = shift; |
25
|
30
|
|
|
|
|
32
|
my $attr = shift; |
26
|
|
|
|
|
|
|
|
27
|
30
|
|
|
|
|
79
|
my $stuff = $self->_from_opaque($self->opaque); |
28
|
30
|
|
|
|
|
59
|
my $old = $stuff->{$attr}; |
29
|
30
|
100
|
|
|
|
69
|
if (@_) { |
30
|
15
|
|
|
|
|
26
|
$stuff->{$attr} = shift; |
31
|
15
|
|
|
|
|
34
|
$self->opaque( $self->_to_opaque($stuff) ); |
32
|
|
|
|
|
|
|
} |
33
|
30
|
|
|
|
|
532
|
return $old; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _from_opaque { |
37
|
30
|
|
|
30
|
|
423
|
my($self, $opaque) = @_; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# relaxed regexp rather than from the ABNF in RFC 4151 |
40
|
30
|
|
|
|
|
32
|
my $stuff; |
41
|
30
|
|
|
|
|
1233
|
$opaque =~ /^([\w\-\.\@]*)(?:,(\d{4}(?:-\d\d(?:-\d\d)?)?)?(?::([$URI::uric]*))?)?$/; |
42
|
30
|
|
|
|
|
434
|
$stuff->{authority} = $1; |
43
|
30
|
|
|
|
|
68
|
$stuff->{date} = $2; |
44
|
30
|
|
|
|
|
59
|
$stuff->{specific} = $3; |
45
|
|
|
|
|
|
|
|
46
|
30
|
|
|
|
|
68
|
$stuff; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub _to_opaque { |
50
|
15
|
|
|
15
|
|
25
|
my($self, $stuff) = @_; |
51
|
|
|
|
|
|
|
|
52
|
15
|
100
|
|
|
|
21
|
sprintf "%s,%s:%s", map { $stuff->{$_} || '' } qw( authority date specific ); |
|
45
|
|
|
|
|
216
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
__END__ |