$url = param('url');
print "url=$url<BR>\n";
$url =~ m|(\w+)://([^/:]+)(:\d+)?/(.*)|; # use m|...| so that we do not need to use a lot of "\/"
$protocol = $1;
$domainName = $2;
$uri = "/" . $4;
print "\$3=$3<BR>\n";
if ($3 =~ /:(\d+)/) { $portNo = $1} else { $portNo = 80}
print "protocol=$protocol<BR>domainName=$domainName<BR>
portNo=$portNo<BR> uri=$uri<BR>\n";
print "url=$url<BR>\n";
$url =~ m|(\w+)://([^/:]+)(:\d+)?/(.*)|; # use m|...| so that we do not need to use a lot of "\/"
$protocol = $1;
$domainName = $2;
$uri = "/" . $4;
print "\$3=$3<BR>\n";
if ($3 =~ /:(\d+)/) { $portNo = $1} else { $portNo = 80}
print "protocol=$protocol<BR>domainName=$domainName<BR>
portNo=$portNo<BR> uri=$uri<BR>\n";
No comments:
Post a Comment