<pen...@nsbeta.info> asked:

> Is there a general way to get linux OS's bound ip addresses? for
> example, the IP on eth0, eth1 etc. Thanks.

http://search.cpan.org/~lds/IO-Interface-1.05/Interface.pm could be a "good 
enough" solution for you.

I say "good enough" since it gives you all of the info that you'll get from 
ifconfig, which means that it's unaware of secondary ip addresses bound 
directly to the interface without using an interface alias like ethx:y. For 
that, you'll still need to parse the output from "ip addr show" (The command 
"ip" is part of the iproute2 suite, see 
http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2).

HTH,
Thomas

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to