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

c has asked for the wisdom of the Perl Monks concerning the following question:

I am in need of finding my local machine's IP address assigned to ETH0. I need to get the information independent of resolving a hostname. Instead, I need to pull information from something similar to ifconfig. I could certainly backtick the command into the code and parse out the information, but I would think there would be a cleaner, easier way. Aside from all of the nodes referencing how to find an ip address using Sys::Hostname, I've only found one that address my needs, and I don't think its the best way of doing things.

Is there a better manner, a module or built-in function that may do the trick?

-c