Im trying to learn perl socket without the OO approach.

My get request isnt working, im not sure why.
Take a look?


use IO;
use Socket;

socket(SOCKFD,AF_INET,SOCK_STREAM,getprotobyname("tcp")) || die "Socket Error\n";

$host = gethostbyname("");

$addr = sockaddr_in(80,$host);

connect(SOCKFD,$addr) || die "Connect Error\n";

print SOCKFD "GET /";

    print $_;
This article has been dead for over six months. Start a new discussion instead.