Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Beatnik (493)

  (email not shown publicly)

A 29 year old belgian who likes Mountain Dew, Girl Scout Cookies, Tim Hortons French Vanilla Flavoured Cappucinno, Belgian beer, Belgian chocolate, Belgian women, Magners Cider, chocolate chipped cookies and Perl. Likes snowboarding, snorkling, sailing and silence. Bach can really cheer him up! He still misses his dog.

Project Daddy of Spine [], a mod_perl based CMS.

In his superhero time (8.30 AM to 5.30 PM), he works on world peace.

Journal of Beatnik (493)

Saturday January 17, 2004
09:46 AM

Alcatel Speedtouch IP hack

[ #16871 ]
Quick hack for getting the current IP from my ADSL modem (since it changes every week or so..)

use strict;
use Net::Telnet;

my $host = ''; #Fill in modem IP here
my $user = ''; #You do have a user defined?
my $c = new Net::Telnet (Prompt => '/\=>$/i');
$c->waitfor('/user : $/i');

my @output = $c->cmd("ip aplist");
my @ips = grep { /inet/ } @output;
my ($currentip) = $ips[0] =~ /^.*?addr:([\d\.]+) .*$/;
print $currentip;
Now all I need is some WWW::Mechanize magic :)
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.