Skip to content

Instantly share code, notes, and snippets.

@mattn
Created July 8, 2009 05:05
Show Gist options
  • Select an option

  • Save mattn/142594 to your computer and use it in GitHub Desktop.

Select an option

Save mattn/142594 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use YAML;
use IO::Socket::INET;
my $sock = IO::Socket::INET->new(PeerAddr => 'www.google.com',
PeerPort => 'http(80)',
Proto => 'tcp');
$! = unpack "i", $sock->getsockopt (SOL_SOCKET, SO_ERROR);
warn Dump $!;
# --- Bad file descriptor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment