How to get locally configured IP addresses

A

A. Ma

Does anyone know how to find out what IP addresses are configured locally?
Thanks.

A.Ma
 
G

Gregory Toomey

It was a dark and stormy night, and A. Ma managed to scribble:
Does anyone know how to find out what IP addresses are configured locally?
Thanks.

A.Ma
In linux, ifconfig;

In Perl, system('ifconfig');

gtoomey
 
J

James Willmore

A. Ma said:
Does anyone know how to find out what IP addresses are configured locally?
Thanks.

A.Ma

In Perl? Using a system command? What?

What methods have you tried? Did you search for the answer to your
question? If so, where?

You may far better posting this _exact_ question to another group -or-
rephrase the question into one that this group deals with.

Jim
 
A

A. Ma

Obviously, I needed to get the list of locally configured IP addresses from
a Perl script. I didn't want to do system 'ifconfig' because it is not
portable. It does not work in Windows.

Anyway, if anyone is interested, I found the answer myself. There is a
module from ActiveState called Net::Ifconfig::Wrapper. I tried it yesterday
and it works for both Unix and Windows.

A.Ma
 
J

James Willmore

Obviously, I needed to get the list of locally configured IP
addresses from a Perl script. I didn't want to do system 'ifconfig'
because it is not portable. It does not work in Windows.

Anyway, if anyone is interested, I found the answer myself. There is
a module from ActiveState called Net::Ifconfig::Wrapper. I tried it
yesterday and it works for both Unix and Windows.

A.Ma

< snip - DON'T top post - it's rude:) >

No, it was _not_ obvious. Otherwise, you would have gotten better
responses :)

More importantly, if you had done the leg work _before_ posting, you
would not have had to post at all :)

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Washington [D.C.] is a city of Southern efficiency and Northern
charm. -- John F. Kennedy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,815
Members
47,361
Latest member
RogerDuabe

Latest Threads

Top