Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

find out the own ip-Adress

5 views
Skip to first unread message

pit

unread,
Dec 1, 2009, 10:01:20 AM12/1/09
to
Hi Folks,

Exists some perl-module to find out the ip-adress of a windows-pc on
which a perl/tk-programm (as an executable) is running ?

TIA
Pit

Oliver 'ojo' Bedford

unread,
Dec 1, 2009, 11:44:55 AM12/1/09
to

What do you mean by "own ip address"? On every host there
might exist different network devices with different ip addresses.

One way might be: Sys::Hostname to get the own hostname and then
Use Socket;
$packed_ip = gethostbyname($hostname);

Oliver

felix.da.ru

unread,
Dec 1, 2009, 11:59:02 AM12/1/09
to

Agree. And for external IP it could be some NAT that confuses all
local calculations. (Offtopic?)

pit

unread,
Dec 1, 2009, 12:13:12 PM12/1/09
to

I mean the ip-address of a pc as a client in a network (such like the
output of ipconfig in the dos-console)

Pit

pit

unread,
Dec 1, 2009, 12:41:04 PM12/1/09
to
> Pit- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

thanks all. it works fine

Pit

0 new messages