#!/usr/bin/perl

 ###########################################################################
 #   getmyip - Internet Address Utility, prints IP address of a computer   #
 #                                                                         #
 #   Copyright (C) 2001, 2002 by Alexander Antonov                         #
 #   email: ava@aleant.com                                                 #
 ###########################################################################

 ###########################################################################
 #                                                                         #
 #   This program is free software; you can redistribute it and/or modify  #
 #   it under the terms of the GNU General Public License as published by  #
 #   the Free Software Foundation; either version 2 of the License, or     #
 #   (at your option) any later version.                                   #
 #                                                                         #
 ###########################################################################

use Socket;
use Sys::Hostname;
print inet_ntoa( gethostbyname( hostname() ) || '0.0.0.0' ) . "\n";

