Posted By


Mazzaroth on 02/19/11

Tagged


Statistics


Viewed 145 times
Favorited by 0 user(s)

getLocalhostIpAddress


/ Published in: Perl
Save to your folder(s)



Copy this code and paste it in your HTML
  1. sub getLocalhostIpAddress
  2. {
  3. my @addr = (gethostbyname(hostname()))[4];
  4. return join ('.', unpack ("C4", $addr[0]));
  5. }
  6.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.