[Chicago-talk] Any handy operators for finding the local IP?

wsmith warren at warrenandrachel.com
Tue Mar 15 12:58:11 PST 2005


my @ip_addresses = `/sbin/ifconfig | grep 'inet addr:' | sed -e
's/.*inet addr://' -e 's/ .*//'`

On Tue, 2005-03-15 at 13:50 -0600, Andy Lester wrote:
> On Tue, Mar 15, 2005 at 01:45:38PM -0600, Steve Peters (steve at fisharerojo.org) wrote:
> > The ways to get an IP address from Perl are less than 100% reliable.  To 
> 
> Please also note that chances are your machine answers to at least two
> different IPs: 127.0.0.1, and the outside.  Heaven help you if you
> answer to multiple IPs, on multiple interfaces, or even on the same
> interface!
> 



More information about the Chicago-talk mailing list