=**************************************
= Name: Get Server Header
= Description:This code will get the header of the server and print it out
= By: Damian myerscough
=
= Inputs:Host
=
= Returns:Server header
=
=This code is copyrighted and has= limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=578&lngWId=6=for details.=**************************************

#!/usr/bin/perl
#
#
use IO::Socket;
@Header;
print"Enter The Host: ";
$Host = <STDIN>;
chop($Host);
$Socket = new IO::Socket::INET(PeerAddr => $Host,
PeerPort => 80,
Proto=> 'tcp') || die "Could not Connect $!\n";
print"Connected.\n";
print"Getting Header\n";
print $Socket "GET / HTTP/1.0\n\n";
$i = 0;
while(<$Socket>)
{
@Header[$i] = $_;
$i++;
}
system("clear");
$i = 0;
print"+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+\n";
while($i <= 8)
{
print" @Header[$i++]\n";
}
print"+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+\n\n";
print" $Host Finished\n";