Quick hack for getting the current IP from my ADSL modem (since it changes every week or so..)
#!/usr/bin/perl
Now all I need is some WWW::Mechanize magic :)
use strict;
use Net::Telnet;
my $host = '10.0.0.1'; #Fill in modem IP here
my $user = ''; #You do have a user defined?
my $c = new Net::Telnet (Prompt => '/\=>$/i');
$c->open($host);
$c->waitfor('/user : $/i');
$c->print($user);
my @output = $c->cmd("ip aplist");
$c->close;
my @ips = grep { /inet/ } @output;
my ($currentip) = $ips[0] =~ /^.*?addr:([\d\.]+) .*$/;
print $currentip;