#!/usr/local/bin/perl -w

# Basic network info.  From "man perlfaq9"

use strict;

use Socket;
use Sys::Hostname;

# The "hostname" function gets the system's name:
my $host = hostname();

# ntoa is "name to address" for getting an IP address:
my $addr = inet_ntoa(scalar gethostbyname($host || 'localhost'));

print "Dude, your hostname=$host with address=$addr\n";

