<Message original de Smoot Carl-Mitchell en date du jeudi 22 avril 2004 à 17:07>

> On Thu, 22 Apr 2004 14:20:43 -0700
> "Rajesh Dorairajan" <[EMAIL PROTECTED]> wrote:
> 
> > Sorry. Missed out getting hostname.
> > 
> > use IO::Socket;
> > use Sys::Hostname;
> > 
> > $HOSTNAME = hostname();
> > $ip = inet_ntoa((gethostbyname($HOSTNAME))[4]);

First of all, thank you all for your answers.

> 
> This is okay provided your laptop has a valid host to IP address
> translation available.  On Unix typically either an entry in /etc/hosts
> or a DNS A record entry.

And that is exactly the problem :)
In /etc/hosts : 
127.0.0.1       localhost lothlorien

Which, is, not the "really" good answer. In fact, I am trying to find a way
to have the eth0 IP address.

> 
> Take a look at Net::Interface on CPAN. It appears to let you look at
> interface information in a system independent way.
> 

I just had a look at this module. It is promising. Maybe it is the answer.

For those interested :

http://search.cpan.org/~srz/Net-Interface-0.04/Interface.pm

Thank you all.

> -- 
> Smoot Carl-Mitchell
> Systems/Network Architect
> email: [EMAIL PROTECTED]
> cell: +1 602 421 9005
> home: +1 480 922 7313
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 

-- 
Emmanuel Lesouef
Société Taika - [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to