Fun with Cryptic Errors!

The Perl program:

#! /usr/bin/perl

use IO::Socket::INET;
my $client = IO::Socket::INET->new(PeerAddr => 'www.google.com',
                                   PeerPort => 80,
                                   Proto    => 'TCP',
                                   Type     => SOCK_STREAM)
        or die "Couldn't connect: $!";
close $client;
print "Success\n";

The output:

Couldn't connect: No such file or directory at ./program line 5.

What’s the problem?

Read the rest of this entry »