/
usr
/
share
/
perl5
/
URI
/
/usr/share/perl5/URI
mkdir
upload
Name
Size
Mode
Actions
file/
-
0755
rm
urn/
-
0755
rm
data.pm
3390
0644
edit
dl
rm
Escape.pm
7061
0644
edit
dl
rm
file.pm
9761
0644
edit
dl
rm
ftp.pm
1056
0644
edit
dl
rm
gopher.pm
2428
0644
edit
dl
rm
Heuristic.pm
6527
0644
edit
dl
rm
http.pm
425
0644
edit
dl
rm
https.pm
144
0644
edit
dl
rm
IRI.pm
794
0644
edit
dl
rm
ldap.pm
2924
0644
edit
dl
rm
ldapi.pm
440
0644
edit
dl
rm
ldaps.pm
144
0644
edit
dl
rm
mailto.pm
1657
0644
edit
dl
rm
mms.pm
125
0644
edit
dl
rm
news.pm
1454
0644
edit
dl
rm
nntp.pm
127
0644
edit
dl
rm
nntps.pm
144
0644
edit
dl
rm
pop.pm
1207
0644
edit
dl
rm
QueryParam.pm
4861
0644
edit
dl
rm
rlogin.pm
129
0644
edit
dl
rm
rsync.pm
207
0644
edit
dl
rm
rtsp.pm
125
0644
edit
dl
rm
rtspu.pm
126
0644
edit
dl
rm
sftp.pm
98
0644
edit
dl
rm
sip.pm
1695
0644
edit
dl
rm
sips.pm
143
0644
edit
dl
rm
snews.pm
172
0644
edit
dl
rm
Split.pm
2353
0644
edit
dl
rm
ssh.pm
175
0644
edit
dl
rm
telnet.pm
128
0644
edit
dl
rm
tn3270.pm
128
0644
edit
dl
rm
URL.pm
5487
0644
edit
dl
rm
urn.pm
2175
0644
edit
dl
rm
WithBase.pm
3862
0644
edit
dl
rm
_foreign.pm
107
0644
edit
dl
rm
_generic.pm
5822
0644
edit
dl
rm
_idna.pm
2079
0644
edit
dl
rm
_ldap.pm
3249
0644
edit
dl
rm
_login.pm
231
0644
edit
dl
rm
_punycode.pm
5622
0644
edit
dl
rm
_query.pm
2531
0644
edit
dl
rm
_segment.pm
416
0644
edit
dl
rm
_server.pm
3724
0644
edit
dl
rm
_userpass.pm
1034
0644
edit
dl
rm
Edit:
/usr/share/perl5/URI/Split.pm
(2353B)
package URI::Split; use strict; use warnings; our $VERSION = '5.10'; use Exporter 5.57 'import'; our @EXPORT_OK = qw(uri_split uri_join); use URI::Escape (); sub uri_split { return $_[0] =~ m,(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?,; } sub uri_join { my($scheme, $auth, $path, $query, $frag) = @_; my $uri = defined($scheme) ? "$scheme:" : ""; $path = "" unless defined $path; if (defined $auth) { $auth =~ s,([/?\#]), URI::Escape::escape_char($1),eg; $uri .= "//$auth"; $path = "/$path" if length($path) && $path !~ m,^/,; } elsif ($path =~ m,^//,) { $uri .= "//"; # XXX force empty auth } unless (length $uri) { $path =~ s,(:), URI::Escape::escape_char($1),e while $path =~ m,^[^:/?\#]+:,; } $path =~ s,([?\#]), URI::Escape::escape_char($1),eg; $uri .= $path; if (defined $query) { $query =~ s,(\#), URI::Escape::escape_char($1),eg; $uri .= "?$query"; } $uri .= "#$frag" if defined $frag; $uri; } 1; __END__ =head1 NAME URI::Split - Parse and compose URI strings =head1 SYNOPSIS use URI::Split qw(uri_split uri_join); ($scheme, $auth, $path, $query, $frag) = uri_split($uri); $uri = uri_join($scheme, $auth, $path, $query, $frag); =head1 DESCRIPTION Provides functions to parse and compose URI strings. The following functions are provided: =over =item ($scheme, $auth, $path, $query, $frag) = uri_split($uri) Breaks up a URI string into its component parts. An C<undef> value is returned for those parts that are not present. The $path part is always present (but can be the empty string) and is thus never returned as C<undef>. No sensible value is returned if this function is called in a scalar context. =item $uri = uri_join($scheme, $auth, $path, $query, $frag) Puts together a URI string from its parts. Missing parts are signaled by passing C<undef> for the corresponding argument. Minimal escaping is applied to parts that contain reserved chars that would confuse a parser. For instance, any occurrence of '?' or '#' in $path is always escaped, as it would otherwise be parsed back as a query or fragment. =back =head1 SEE ALSO L<URI>, L<URI::Escape> =head1 COPYRIGHT Copyright 2003, Gisle Aas This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut
Save
cmd:
run