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

Does anybody know of a way of using perl to display the ipaddresses of multiple network cards on one machine. I am trying to test client machines to see if they are dialup users. The way I am trying to do this is to check if their IPaddress is in the range specified for dialup. Currently I am using
use Socket; use Sys::Hostname; my $host = hostname(); my $addr = inet_ntoa(scalar(gethostbyname($name)) || 'localhost');
which works fine on machines with only a modem. I falls down when the client has a NIC in the macine as well. For example, if you have an address of 192.168.1.1 on your network card and an address on your modem of 10.1.0.1 then you are considered to be a local user as $addr returns 192.168.1.1 rather than 10.1.0.1. Because the clients are multiple versions of windows can’t use ipconfig and regex. If anyone can help that would be great.

Edit Masem 2001-11-27 - Code tags

Replies are listed 'Best First'.
Re: Multiple IP Addresses
by mce (Curate) on Nov 27, 2001 at 15:58 UTC
    Hi,
    twice about the same post in one day, it must be tuesday :-).

    Have a look at this and look for the module IO::Interface.

    I hope this helps,
    ---------------------------
    Dr. Mark Ceulemans
    Senior Consultant
    IT Masters, Belgium