Posted By

Mazzaroth on 02/19/11


Tagged


Versions (?)

getLocalhostIpAddress


 / Published in: Perl
 

  1. sub getLocalhostIpAddress
  2. {
  3. my @addr = (gethostbyname(hostname()))[4];
  4. return join ('.', unpack ("C4", $addr[0]));
  5. }
  6.  

Report this snippet  

You need to login to post a comment.