use IO::Socket;

$ip = inet_ntoa((gethostbyname($HOSTNAME))[4]);

Rajesh

> -----Original Message-----
> From: Emmanuel Lesouef [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 22, 2004 1:02 PM
> To: [EMAIL PROTECTED]
> Subject: Finding the current IP of my laptop
> 
> 
> Hello all,
> 
> I am trying to build a little script (my first one...) that 
> launches several
> commands depending on the current IP address of my laptop.
> 
> I would like to use a perl module instead of grep'ing the result of
> ifconfig.
> 
> Do you have so guidelines to give me ?
> 
> Thanks in advance.
> 
> -- 
> Emmanuel Lesouef
> 
> -- 
> 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