#!/bin/perl5 use strict; use warnings; use Win32::Internet; use Socket; use Sys::Hostname; my $INET = new Win32::Internet() or die qq(Cannot connect to Internet); my @error = $INET->Error; print "@error\n"; my $URL; $INET->OpenURL($URL, "http://www.yahoo.com/"); my $host = hostname(); my $addr = inet_ntoa(scalar gethostbyname($host || 'localhost')); print "$addr\n";