#!/usr/bin/perl -w use strict; use Socket; my $hostname = gethostbyname('whatismyip.com'); print inet_ntoa($hostname) . "\n";