For a non-Perl answer.. has he heard of http://www.dyndns.org ? I use their
(free) service for my home connection, and have my own Perl script which
updates their database when needed.
For my home one, I LWP to my router and get my WAN IP, but that isn't what you
seem to need :)
Anyways.. look at the documentation for gethostbyname, Socket, and I believe
there is a recipe in The Perl Cookbook for this.
However, for sanity sake, I would suggest to your friend that he gets a dyndns
account (there are clients available on their site to update the IP when it
changes) so he can always access his home computer more easily.
Cheers,
Kevin
On Thu, May 24, 2001 at 11:38:35AM -0700, David Matthew Monarres ([EMAIL PROTECTED])
spew-ed forth:
> I wrote a program for my friend that will email him
> his ip address if it has change while he was go (I
> told him that this wasn't a great idea but he said it
> was the only way that he could access a home machine
> from work if his dsl dropped the connection) Right now
> I have a very rough version but it just seems ugly. He
> uses LINUX so basically I spawn an ifconfig and parse
> through the output. It would seem to me that since
> perl has a ton of networking libs that it would have
> one to get the ip of a given piece of hardware. I
> looked in the camel but didn't find anything that I
> thought that I could use. Was I wrong? would CPAN have
> something. Thank you in advance.
> David Monarres <[EMAIL PROTECTED]>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
--
[Writing CGI Applications with Perl - http://perlcgi-book.com]
"If you understand what you're doing, you're not learning anything."
-- Abraham Lincoln