thank Bill.
that is what i want.

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Im Auftrag von
$Bill Luebkert
Gesendet: Mittwoch, 10. Januar 2001 11:47
An: Kristofer Wolff
Cc: perllist
Betreff: Re: IO::Socket::INET


Kristofer Wolff wrote:
>
> hi, does anybody know a way to find out the server name, or/and the ip
> number ?
> I start a server:
>
> $server = IO::Socket::INET->new( Proto     => 'tcp',
>                           LocalPort => $PORT,
>                           Listen    => SOMAXCONN,
>                           Reuse     => 1);
>
> and want to set $this_server = "" // somthing like
"ip29.internet-shop.net"
>
> is it possible to find out the name of the server i generated ?

Another version if you don't have Net::Domain:

use Socket;
my $name = (gethostbyname ('localhost'))[0];
my $addr = (gethostbyname ($name))[4];
$name = (gethostbyaddr ($addr, AF_INET))[0];
print "name=$name\n";

--
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   http://www.todbe.com/
  / ) /--<  o // //      Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_</_</_    http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to