#!/usr/bin/perl
# the interface is what your external IP is bound to- eth0 or ppp0, most likely
# if you're on ADSL/dialup, it's probably ppp0
$interface="wlan0";
# path to ifconfig
$ifconfig="/sbin/ifconfig";
@lines=qx|$ifconfig $interface| or die("Can't get info from ifconfig: ".$!);
foreach(@lines){
        if(/inet addr:([\d.]+)/){
                print "$1\n";
        }
}
