in reply to Re: How do I get the local internet IP address?
in thread How do I get the local internet IP address?

Net::Address::IP::Local is easier to use, more reliable, and cross-platform...

use Net::Address::IP::Local; my $address = Net::Address::IP::Local->public;

www.jasonkohles.com
We're not surrounded, we're in a target-rich environment!

Replies are listed 'Best First'.
Re^2: Answer: How do I get the local internet IP address?
by Your Mother (Archbishop) on Aug 14, 2008 at 06:53 UTC

    The OP code did work for me though on a closed box and Net::Address::IP::Local only seems to work if there is, as the method name suggests, a public address open otherwise it's Unable to create UDP socket: No route to host.... The OP code found the right address on both my running OS X boxes, one closed, one open.