You are looking at a very old, but free version of the course. If you are interesed the most recent version, check it out on the Perl Maven site.

8.3. Socket level programming using IO::Socket

Example 8-2. examples/network/

use strict;
use warnings;

use IO::Socket;

# IO::Socket is a higher level abstraction
# Hides many of the ugly part we had to know in case of the socket() function.
# Provides an OOP interface.

#my $host = '';
my $host = 'localhost';
#my $host = '';
#my $host = '';
#my $host = '';

my $port = 80;
my $CRLF = "\015\012";

my $socket = IO::Socket::INET->new(
            PeerAddr => $host,
            PeerPort => $port,
            Proto    => 'tcp',
        ) or die $!;

$socket->send("GET /$CRLF") or die $!;

my $SIZE = 100;
my $data = '';
while ($socket->read($data, $SIZE, length $data) == $SIZE) {};
print $data;

If you are interested in on-site trainings by the author, please contact me directly.