| 1 | package POEx::URI; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 7 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 7 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 7 | ▶ | use URI::Escape qw(uri_unescape); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 7 | ▶ | use URI::_server; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 7 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 7 | ▶ | use vars qw( @ISA $VERSION ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 7 | @ISA = qw(URI::_server); | |||||||||||||||||||||||||||||||||||||||||
| 12 | 7 | $VERSION = '0.0301'; | |||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 7 | ▶ | use overload '@{}' => \&as_array, | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 7 | fallback => 1; | |||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 18 | sub _init | ||||||||||||||||||||||||||||||||||||||||||
| 19 | 31 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_init: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 31 | my( $class, $str, $scheme ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 31 | ▶ | if( $str =~ m,^poe://[^/]+/[^/]+$, ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | $str .= '/'; | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 31 | ▶ | $str = "$scheme:$str" unless $str =~ /^\Q$scheme:/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | 31 | return $class->SUPER::_init($str, $scheme); | |||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 31 | 4 | ▶ | sub default_port { 603 } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_port: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 34 | sub kernel | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 66 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
kernel: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 66 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 37 | 66 | my $old = $self->authority; | |||||||||||||||||||||||||||||||||||||||||
| 38 | 66 | ▶ | if( @_ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 16 | my $tmp = $old; | |||||||||||||||||||||||||||||||||||||||||
| 40 | 16 | ▶ | $tmp = "" unless defined $old; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | 16 | ▶ | my $ui = ($tmp =~ /(.*@)/) ? $1 : ""; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 16 | my $new = shift; | |||||||||||||||||||||||||||||||||||||||||
| 43 | 16 | ▶ | $new = "" unless defined $new; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | 16 | ▶ | if (length $new) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | 14 | $new =~ s/[@]/%40/g; # protect @ | |||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||
| 47 | 16 | ▶ | if( $ui or length $new ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$ui or length $new
MC/DC50%1/2
$ui or length $new
$ui
length $new
Truth table66%2/3
A or B
A= $uiB= length $new
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | 14 | $self->authority( "$ui$new" ); | |||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||
| 50 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 2 | $self->authority( undef ); | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||
| 54 | 66 | ▶ | return undef unless defined $old; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | 41 | $old =~ s/.*@//; | |||||||||||||||||||||||||||||||||||||||||
| 56 | 41 | return uri_unescape($old); | |||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 61 | sub path | ||||||||||||||||||||||||||||||||||||||||||
| 62 | 283 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
path: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 63 | 283 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 64 | 283 | my $old = $self->SUPER::path; | |||||||||||||||||||||||||||||||||||||||||
| 65 | 283 | ▶ | if( @_ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 54 | my $new = shift; | |||||||||||||||||||||||||||||||||||||||||
| 67 | 54 | ▶ | if( $new =~ m,(.+)/(.+), ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | 32 | my $session = $1; | |||||||||||||||||||||||||||||||||||||||||
| 70 | 32 | my $event = $2; | |||||||||||||||||||||||||||||||||||||||||
| 71 | 32 | $session =~ s,^/+,,; | |||||||||||||||||||||||||||||||||||||||||
| 72 | 32 | $session =~ s,/,%2F,g; | |||||||||||||||||||||||||||||||||||||||||
| 73 | 32 | $new = join '/', $session, $event; | |||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||
| 75 | 54 | $self->SUPER::path( $new ); | |||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 283 | return $old; | |||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 81 | sub path_segments | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 178 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
path_segments: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | 178 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||
| 85 | 178 | my @seg = $self->SUPER::path_segments; | |||||||||||||||||||||||||||||||||||||||||
| 86 | 178 | ▶ | if( @_ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | 49 | my @new = @_; | |||||||||||||||||||||||||||||||||||||||||
| 88 | 49 | ▶ | shift @new if $new[0] eq ''; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 49 | ▶ | if( 2 <= @new ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 43 | my $event = pop @new; | |||||||||||||||||||||||||||||||||||||||||
| 91 | 43 | @new = ( join( '/', @new ), $event ); | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | 49 | $self->SUPER::path_segments( @new ); | |||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 178 | return @seg; | |||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 99 | sub session | ||||||||||||||||||||||||||||||||||||||||||
| 100 | 48 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
session: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | 48 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 102 | 48 | my @seg = $self->path_segments; | |||||||||||||||||||||||||||||||||||||||||
| 103 | 48 | ▶ | shift @seg if defined $seg[0] and $seg[0] eq ''; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $seg[0] and $seg[0] eq ""
MC/DC100%2/2
defined $seg[0] and $seg[0] eq ""
defined $seg[0]
$seg[0] eq ""
Truth table100%3/3
A and B
A= defined $seg[0]B= $seg[0] eq ""
| |||||||||||||||||||||||||||||||||||||||||||
| 104 | 48 | my $event; | |||||||||||||||||||||||||||||||||||||||||
| 105 | 48 | ▶ | if( 1==@seg ) { # only an event? | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 10 | $event = $seg[0]; | |||||||||||||||||||||||||||||||||||||||||
| 107 | 10 | @seg = (); | |||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||
| 109 | 48 | ▶ | if( @seg >= 2 ) { # session + event | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 35 | $event = pop @seg; | |||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||
| 112 | 48 | my $old = join '/', @seg[0..$#seg]; | |||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||
| 114 | 48 | ▶ | if( @_ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | 14 | my $new = shift; | |||||||||||||||||||||||||||||||||||||||||
| 116 | 14 | ▶ | $new = '' unless defined $new; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | 14 | ▶ | $self->path_segments( $new, (defined $event ? $event : '' ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | 48 | return $old; | |||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 124 | sub event | ||||||||||||||||||||||||||||||||||||||||||
| 125 | 39 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
event: called CC=10 SCAR=23.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | 39 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 127 | 39 | my $old = ( $self->path_segments )[-1]; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 39 | ▶ | $old = '' unless defined $old; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | 39 | ▶ | if( @_ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 130 | 11 | my @seg = $self->path_segments; | |||||||||||||||||||||||||||||||||||||||||
| 131 | 11 | my $new = shift; | |||||||||||||||||||||||||||||||||||||||||
| 132 | 11 | ▶ | if( @seg >= 2 ) { # session/event | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | 8 | ▶ | $seg[-1] = $new||''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$new || ''
MC/DC100%1/1
$new || ''
$new
Truth table100%2/2
A
A= $new
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||
| 135 | elsif( @seg ) { # session | ||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | push @seg, $new||''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$new || ''
MC/DC0%0/1
$new || ''
$new
Truth table0%0/2
A
A= $new
| |||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | else { # nothing | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 3 | ▶ | if( $self->kernel and defined $new ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->kernel and defined $new
MC/DC0%0/2
$self->kernel and defined $new
$self->kernel
defined $new
Truth table66%2/3
A and B
A= $self->kernelB= defined $new
| |||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | carp "It makes no sense to set an event without a session"; | |||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||
| 142 | 3 | ▶ | @seg = ('', $new||''); | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$new || ''
MC/DC100%1/1
$new || ''
$new
Truth table100%2/2
A
A= $new
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||
| 145 | 11 | $self->path_segments( @seg ); | |||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||
| 147 | 39 | return $old; | |||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||
| 150 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 151 | sub _user | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 5 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_user: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 5 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 154 | 5 | my $old = $self->userinfo; | |||||||||||||||||||||||||||||||||||||||||
| 155 | 5 | $old =~ s/:.*$//; | |||||||||||||||||||||||||||||||||||||||||
| 156 | 5 | return $old; | |||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||
| 158 | sub user | ||||||||||||||||||||||||||||||||||||||||||
| 159 | 8 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
user: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 160 | 8 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 161 | 8 | my $old = $self->userinfo; | |||||||||||||||||||||||||||||||||||||||||
| 162 | 8 | $old =~ s/:.*$//; | |||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||
| 164 | 8 | ▶ | if( @_ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 165 | 4 | my $pw = $self->_password; | |||||||||||||||||||||||||||||||||||||||||
| 166 | 4 | my $new = shift; | |||||||||||||||||||||||||||||||||||||||||
| 167 | 4 | my $ui = $new; | |||||||||||||||||||||||||||||||||||||||||
| 168 | 4 | ▶ | if( defined $new ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 169 | 2 | $new =~ s/:/%3A/g; | |||||||||||||||||||||||||||||||||||||||||
| 170 | 2 | $ui = $new; | |||||||||||||||||||||||||||||||||||||||||
| 171 | 2 | ▶ | $ui .= ":$pw" if( defined $pw ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||
| 173 | elsif( defined $pw ) { | ||||||||||||||||||||||||||||||||||||||||||
| 174 | 1 | $ui = ":$pw"; | |||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 4 | $self->userinfo( $ui ); | |||||||||||||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||
| 179 | 8 | ▶ | $old =~ s/%3A/:/g if $old; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | 8 | return $old; | |||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 184 | sub _password | ||||||||||||||||||||||||||||||||||||||||||
| 185 | 4 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_password: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 186 | 4 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 187 | 4 | my $old = $self->userinfo; | |||||||||||||||||||||||||||||||||||||||||
| 188 | 4 | ▶ | undef( $old ) unless $old =~ s/^.*?://; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 189 | 4 | return $old; | |||||||||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||||||||
| 191 | sub password | ||||||||||||||||||||||||||||||||||||||||||
| 192 | 9 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
password: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 193 | 9 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 194 | 9 | my $old = $self->userinfo; | |||||||||||||||||||||||||||||||||||||||||
| 195 | 9 | ▶ | undef( $old ) unless $old =~ s/^.*?://; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||
| 197 | 9 | ▶ | if( @_ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 198 | 5 | my $user = $self->_user; | |||||||||||||||||||||||||||||||||||||||||
| 199 | 5 | ▶ | $user = '' unless defined $user; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 200 | 5 | my $new = shift; | |||||||||||||||||||||||||||||||||||||||||
| 201 | 5 | ▶ | if( defined $new ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 202 | 3 | $new =~ s/:/%3A/g; | |||||||||||||||||||||||||||||||||||||||||
| 203 | 3 | $self->userinfo( "$user:$new" ); | |||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||
| 205 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 206 | 2 | $self->userinfo( $user ); | |||||||||||||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||
| 209 | 9 | ▶ | $old =~ s/%3A/:/g if $old; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 210 | 9 | return $old; | |||||||||||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||
| 213 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 214 | sub _is_inet | ||||||||||||||||||||||||||||||||||||||||||
| 215 | 29 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_inet: called CC=7 SCAR=20.1
| |||||||||||||||||||||||||||||||||||||||||||
| 216 | 29 | my $kernel = shift; | |||||||||||||||||||||||||||||||||||||||||
| 217 | 29 | ▶ | return unless $kernel; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 218 | 20 | ▶ | return 1 if $kernel =~ /:\d*$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 219 | 17 | ▶ | return 1 if $kernel =~ /^\[[:0-9a-f]+\]$/i; # [IPv6] | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 220 | 17 | ▶ | return 1 if $kernel =~ /^\d+\.\d+\.\d+\.\d+/; # IPv4 dotted quad | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 221 | 16 | ▶ | return 1 if $kernel =~ /^[-\w.]+$/ and $kernel =~ /[.]/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$kernel =~ /^[-\w.]+$/ and $kernel =~ /[.]/
MC/DC0%0/2
$kernel =~ /^[-\w.]+$/ and $kernel =~ /[.]/
$kernel =~ /^[-\w.]+$/
$kernel =~ /[.]/
Truth table33%1/3
A and B
A= $kernel =~ /^[-\w.]+$/B= $kernel =~ /[.]/
| |||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||
| 224 | sub canonical | ||||||||||||||||||||||||||||||||||||||||||
| 225 | 29 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
canonical: called CC=11 SCAR=24.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 226 | 29 | my( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 227 | 29 | my $other = $self->URI::_generic::canonical(); | |||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||
| 230 | 29 | my $kernel = $self->kernel; | |||||||||||||||||||||||||||||||||||||||||
| 231 | 29 | ▶ | if( _is_inet( $kernel ) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 232 | 4 | ▶ | $other = $other->clone if $other == $self; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 233 | 4 | $other->kernel( lc $kernel ); | |||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||
| 235 | 29 | my $port = $other->_port; | |||||||||||||||||||||||||||||||||||||||||
| 236 | 29 | ▶ | if( defined($port) && ($port eq "" || $port == $self->default_port) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
defined $port and $port eq "" || $port == $self->default_port
$port eq "" or $port == $self->default_port
MC/DC66%2/3
defined $port and $port eq "" || $port == $self->default_port
defined $port
$port eq ""
$port == $self->default_port
Truth table75%3/4
A and B or C
A= defined $portB= $port eq ""C= $port == $self->default_port
| |||||||||||||||||||||||||||||||||||||||||||
| 237 | 2 | ▶ | $other = $other->clone if $other == $self; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 238 | 2 | $other->port(undef); | |||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||
| 241 | 29 | ▶ | if( $other =~ m(poe:/[^/]) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 242 | 4 | ▶ | $other = $other->clone if $other == $self; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 243 | 4 | $$other =~ s(poe:/)(poe:); | |||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||
| 246 | 29 | my @seg = $other->path_segments; | |||||||||||||||||||||||||||||||||||||||||
| 247 | 29 | ▶ | if( 2 < @seg ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 248 | 21 | ▶ | $other = $other->clone if $other == $self; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 249 | 21 | $other->path_segments( @seg ); # enforce 2 segments | |||||||||||||||||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||
| 252 | 29 | return $other; | |||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||||||||||||
| 255 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 256 | sub fragment | ||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fragment: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | ▶ | return if 1==@_; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | croak "->fragment() currently not supported"; | |||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||
| 262 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 263 | sub as_array | ||||||||||||||||||||||||||||||||||||||||||
| 264 | 7 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
as_array: called CC=7 SCAR=20.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 265 | 7 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 266 | 7 | my $kid; | |||||||||||||||||||||||||||||||||||||||||
| 267 | 7 | ▶ | $kid = $POE::Kernel::poe_kernel->ID | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$POE::Kernel::poe_kernel and $POE::Kernel::poe_kernel->can("ID")
MC/DC0%0/2
$POE::Kernel::poe_kernel and $POE::Kernel::poe_kernel->can("ID")
$POE::Kernel::poe_kernel
$POE::Kernel::poe_kernel->can("ID")
Truth table33%1/3
A and B
A= $POE::Kernel::poe_kernelB= $POE::Kernel::poe_kernel->can("ID")
| |||||||||||||||||||||||||||||||||||||||||||
| 268 | if $POE::Kernel::poe_kernel and $POE::Kernel::poe_kernel->can('ID'); | ||||||||||||||||||||||||||||||||||||||||||
| 269 | 7 | my $kernel = $self->kernel; | |||||||||||||||||||||||||||||||||||||||||
| 270 | 7 | my $alias = $self->session; | |||||||||||||||||||||||||||||||||||||||||
| 271 | 7 | ▶ | if( $kernel and ( not $kid or $kernel ne $kid ) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
$kernel and !$kid || $kernel ne $kid
not $kid or $kernel ne $kid
MC/DC33%1/3
$kernel and !$kid || $kernel ne $kid
$kernel
not $kid
$kernel ne $kid
Truth table50%2/4
A and not(B) or C
A= $kernelB= not $kidC= $kernel ne $kid
| |||||||||||||||||||||||||||||||||||||||||||
| 272 | 2 | $alias = join '/', $self->scheme.':/', $kernel, $alias; | |||||||||||||||||||||||||||||||||||||||||
| 273 | } | ||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||
| 275 | 7 | my @ret = ( $alias, $self->event, $self->argument ); | |||||||||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||||||||||
| 277 | 7 | ▶ | return \@ret unless wantarray; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 278 | 1 | return @ret; | |||||||||||||||||||||||||||||||||||||||||
| 279 | } | ||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||
| 281 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 282 | sub argument | ||||||||||||||||||||||||||||||||||||||||||
| 283 | 7 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
argument: called CC=6 SCAR=29.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 284 | 7 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 285 | 7 | my $old = $self->_argument; | |||||||||||||||||||||||||||||||||||||||||
| 286 | 7 | ▶ | if( @_ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | ▶ | if( 1==@_ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | my $new = shift; | |||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | ▶ | unless( ref $new ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | $self->query( $new ); | |||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||
| 292 | elsif( 'ARRAY' eq ref $new ) { | ||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | $self->query_keywords( $new ); | |||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||
| 295 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | $self->query_form( $new ); | |||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||||||||||||||||
| 299 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | $self->query_form( @_ ); | |||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||||||||||||||
| 303 | 7 | ▶ | return unless defined $old; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | return $old; | |||||||||||||||||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||||||||||
| 307 | sub _argument | ||||||||||||||||||||||||||||||||||||||||||
| 308 | 7 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_argument: called CC=4 SCAR=22.6
| |||||||||||||||||||||||||||||||||||||||||||
| 309 | 7 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 310 | 7 | my $args; | |||||||||||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||||||||||
| 312 | 7 | my $q = $self->query; | |||||||||||||||||||||||||||||||||||||||||
| 313 | 7 | ▶ | return unless defined $q; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | ▶ | if( $q =~ /=/ ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 316 | 0 | return { map { s/\+/ /g; uri_unescape($_) } | |||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | map { /=/ ? split(/=/, $_, 2) : ($_ => '')} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 318 | split(/&/, $q) | ||||||||||||||||||||||||||||||||||||||||||
| 319 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 320 | } | ||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | return [ map { uri_unescape($_) } split(/\+/, $q, -1) ]; | |||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||||||||||||||
| 324 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 325 | sub abs | ||||||||||||||||||||||||||||||||||||||||||
| 326 | 6 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
abs: called CC=8 SCAR=21.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 327 | 6 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 328 | 6 | ▶ | my $base = shift || croak "Missing base argument"; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
shift() || croak('Missing base argument')
MC/DC0%0/1
shift() || croak('Missing base argument')
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||
| 330 | 6 | ▶ | $base = URI->new($base) unless ref $base; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 331 | 6 | $base = $base->canonical; | |||||||||||||||||||||||||||||||||||||||||
| 332 | 6 | my $abs = $self->clone; | |||||||||||||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||||||||||||||
| 334 | 6 | ▶ | $abs->scheme( $base->scheme ) unless $abs->scheme; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 335 | 6 | foreach my $part ( qw( event session authority ) ) { | |||||||||||||||||||||||||||||||||||||||||
| 336 | 18 | my $f = $abs->$part; | |||||||||||||||||||||||||||||||||||||||||
| 337 | 18 | ▶ | next if defined $f and length $f; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $f and length $f
MC/DC100%2/2
defined $f and length $f
defined $f
length $f
Truth table100%3/3
A and B
A= defined $fB= length $f
| |||||||||||||||||||||||||||||||||||||||||||
| 338 | 9 | $f = $base->$part; | |||||||||||||||||||||||||||||||||||||||||
| 339 | 9 | ▶ | next unless length $f; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 340 | 9 | $abs->$part( $base->$part ); | |||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||
| 342 | 6 | return $abs; | |||||||||||||||||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||||||||||
| 345 | ############################################## | ||||||||||||||||||||||||||||||||||||||||||
| 346 | sub rel | ||||||||||||||||||||||||||||||||||||||||||
| 347 | 3 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
rel: called CC=13 SCAR=26.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 348 | 3 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 349 | 3 | ▶ | my $base = shift || croak "Missing base argument"; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
shift() || croak('Missing base argument')
MC/DC0%0/1
shift() || croak('Missing base argument')
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||
| 351 | 3 | my $rel = $self->clone; | |||||||||||||||||||||||||||||||||||||||||
| 352 | 3 | ▶ | $base = URI->new($base) unless ref $base; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||
| 354 | 3 | my $scheme = $rel->scheme; | |||||||||||||||||||||||||||||||||||||||||
| 355 | 3 | my $auth = $rel->canonical->authority; | |||||||||||||||||||||||||||||||||||||||||
| 356 | 3 | my $session = $rel->session; | |||||||||||||||||||||||||||||||||||||||||
| 357 | 3 | my $event = $rel->event; | |||||||||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||||||||||
| 359 | 3 | ▶ | if (!defined($scheme) && !defined($auth)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $scheme or defined $auth
MC/DC0%0/2
defined $scheme or defined $auth
defined $scheme
defined $auth
Truth table33%1/3
A or B
A= defined $schemeB= defined $auth
| |||||||||||||||||||||||||||||||||||||||||||
| 360 | # it is already relative | ||||||||||||||||||||||||||||||||||||||||||
| 361 | 0 | return $rel; | |||||||||||||||||||||||||||||||||||||||||
| 362 | } | ||||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||||
| 364 | 3 | my $bscheme = $base->scheme; | |||||||||||||||||||||||||||||||||||||||||
| 365 | 3 | my $bauth = $base->canonical->authority; | |||||||||||||||||||||||||||||||||||||||||
| 366 | 3 | my $bsession = $base->session; | |||||||||||||||||||||||||||||||||||||||||
| 367 | 3 | my $bevent = $base->event; | |||||||||||||||||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||||||||||||||||
| 369 | 3 | for ($bscheme, $bauth, $auth) { | |||||||||||||||||||||||||||||||||||||||||
| 370 | 9 | ▶ | $_ = '' unless defined | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 371 | } | ||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||
| 373 | 3 | ▶ | unless ($scheme eq $bscheme && $auth eq $bauth) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$scheme eq $bscheme and $auth eq $bauth
MC/DC50%1/2
$scheme eq $bscheme and $auth eq $bauth
$scheme eq $bscheme
$auth eq $bauth
Truth table66%2/3
A and B
A= $scheme eq $bschemeB= $auth eq $bauth
| |||||||||||||||||||||||||||||||||||||||||||
| 374 | # different location, can't make it relative | ||||||||||||||||||||||||||||||||||||||||||
| 375 | 1 | return $rel; | |||||||||||||||||||||||||||||||||||||||||
| 376 | } | ||||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||
| 378 | # Make it relative by eliminating scheme and authority | ||||||||||||||||||||||||||||||||||||||||||
| 379 | 2 | $rel->scheme(undef); | |||||||||||||||||||||||||||||||||||||||||
| 380 | 2 | $rel->authority(undef); | |||||||||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||||||||||
| 382 | 2 | for ($session, $event, $bsession, $bevent) { | |||||||||||||||||||||||||||||||||||||||||
| 383 | 8 | ▶ | $_ = '' unless defined | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 384 | } | ||||||||||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||||||||||
| 386 | 2 | ▶ | if( $bsession eq $session ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 387 | 1 | $rel->session(undef); | |||||||||||||||||||||||||||||||||||||||||
| 388 | } | ||||||||||||||||||||||||||||||||||||||||||
| 389 | 2 | ▶ | if( $bevent eq $event ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 390 | 0 | $rel->event(undef); | |||||||||||||||||||||||||||||||||||||||||
| 391 | } | ||||||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||||
| 393 | 2 | return $rel; | |||||||||||||||||||||||||||||||||||||||||
| 394 | } | ||||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||
| 396 | 7 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||||||||||||||||
| 398 | __END__ | ||||||||||||||||||||||||||||||||||||||||||