http://www.perlmonks.org?node_id=127730

r.joseph has asked for the wisdom of the Perl Monks concerning the following question:

Quick question - I want to get the correct IP address (and if possible, hostname) for my computer (ie: localhost)...this:
($a, $b, $c, $d) = unpack('C4', ((gethostbyname('localhost'))[4])[0]); print "$a.$b.$c.$d\n";
Always returns 127.0.0.1 - how do I get my real IP (which is currently 206.62.155.15)? Thanks!

r. j o s e p h
"Violence is a last resort of the incompetent" - Salvor Hardin, Foundation by Issac Asimov