>> The admin asked me what command I use in order to get the name 
'localhost.testdrive.hp.com'. How does MP2 get this?
 >
 >Something like the following:
 >
 >use Socket;
 >my $localhost_addr = pack('C4', 127, 0, 0, 1);
 >my $name = gethostbyaddr($localhost_addr, Socket::AF_INET()) || 'localhost';
 >my $iaddr = (gethostbyname($name))[-1];
 >unless (defined $iaddr) {
 >         die "Can't resolve host: '$name' (check /etc/hosts)";
 >}
 >$remote_addr ||= Socket::inet_ntoa($iaddr);
 >print $remote_addr;
 >
 >prints 127.0.0.1 on my machine.
 >
 >--

They ask me this: :)

When I show this to one of the engineers here we are confused
as to what information or what you are trying to do with these
commands. Can you please explain what you are trying to do?

It tries to resolve 127.0.0.1.

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to