a.pl
a1.plprint "Content type: text/html\n\n\n"; print "hello";
a2.plprint "Content type: text/html\n\n\n"; print "<b>hello</b>";
print "Content-type: text/plain\r\n\r\n",;
print "REQUEST_METHOD: " ,$ENV{"REQUEST_METHOD"},"\r\n";
print "SCRIPT_NAME: ",$ENV{"SCRIPT_NAME"} ,"\r\n";
print "QUERY_STRING: ",$ENV{"QUERY_STRING"},"\r\n";
print "PATH_INFO: ",$ENV{"PATH_INFO"},"\r\n";
print "PATH_TRANSLATED: ",$ENV{"PATH_TRANSLATED"},"\r\n";
print "CONTENT_TYPE: ",$ENV{"CONTENT_TYPE"},"\r\n";
print "CONTENT_LENGTH: ",$ENV{"CONTENT_LENGTH"},"\r\n";
a3.pl
$port = 80 ;
$them = 'www.microsoft.com' ;
$sockaddr = 'S n a4 x8';
($name,$aliases,$type,$len,$thataddr) = gethostbyname($them);
$that = pack($sockaddr, 2, $port, $thataddr);
if (socket(S, 2, 1, 0)) {
print "socket ok\n";
}
if (connect(S,$that)) {
print "connect ok\n";
}
if ( send (S,"GET /intdev/\r\n",0))
{
print "send ok\n";
}
while ( <S> )
{
print ;
}
The above tutorial is a joint effort of
Mr. Vijay Mukhi
Ms. Sonal Kotecha
Move back to the Vijay Mukhi's Technology Cornucopia Page to learn more about the other new Internet Technologies.