CGI - Perl


a.pl

print "Content type: text/html\n\n\n";
print "hello";
a1.pl
print "Content type: text/html\n\n\n";
print "<b>hello</b>";
a2.pl
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 ;
}

This page is still under construction.

The above tutorial is a joint effort of

Mr. Vijay Mukhi
Ms. Sonal Kotecha


If you have any suggestions, comments, ideas, cracked code, feedback, feel free to get in touch with us.

Move back to the Vijay Mukhi's Technology Cornucopia Page to learn more about the other new Internet Technologies.


Vijay Mukhi's Computer Institute
VMCI, B-13, Everest Building, Tardeo, Bombay 400 034, India
E-mail:vmukhi@giasbm01.vsnl.net.in Tel : 91-22-496 4335 /6/7/8/9 Fax : 91-22-307 28 59
http://www.vijaymukhi.com