home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_fe1f43d0e6e14a52ad8e0c721c1eb70f
< prev
next >
Wrap
Text File
|
2000-03-15
|
760b
|
35 lines
package URI::http;
require URI::_server;
@ISA=qw(URI::_server);
use strict;
use vars qw(%unreserved_escape);
sub default_port { 80 }
sub canonical
{
my $self = shift;
my $other = $self->SUPER::canonical;
my $slash_path = defined($other->authority) &&
!length($other->path) && !defined($other->query);
if ($slash_path || $$other =~ /%/) {
$other = $other->clone if $other == $self;
unless (%unreserved_escape) {
for ("A" .. "Z", "a" .. "z", "0" .."9",
"-", "_", ".", "!", "~", "*", "'", "(", ")"
) {
$unreserved_escape{sprintf "%%%02X", ord($_)} = $_;
}
}
$$other =~ s/(%[0-9A-F]{2})/$unreserved_escape{$1} || $1/ge;
$other->path("/") if $slash_path;
}
$other;
}
1;