Sorry. Missed out getting hostname. use IO::Socket; use Sys::Hostname;
$HOSTNAME = hostname(); $ip = inet_ntoa((gethostbyname($HOSTNAME))[4]); Rajesh > -----Original Message----- > From: Rajesh Dorairajan > Sent: Thursday, April 22, 2004 2:18 PM > To: 'Emmanuel Lesouef'; [EMAIL PROTECTED] > Subject: RE: Finding the current IP of my laptop > > > 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> > > > > > > >