in reply to Trying to get information about network interfaces

Hi iRemix94,

I've successfully been using IO::Interface::Simple. A quick example:

use IO::Interface::Simple (); for my $if (IO::Interface::Simple->interfaces) { next if !$if->is_running || $if->is_loopback || !defined($if->addr +ess); print $if, "\t", $if->address, "\n"; }

I haven't had to determine whether an interface is virtual or not, but at least these two StackOverflow answers indicate that - at least on Linux - you could determine that by looking at the files in /sys/class/net/.

Hope this helps,
-- Hauke D

Replies are listed 'Best First'.
Re^2: Trying to get information about network interfaces
by iRemix94 (Sexton) on Jun 10, 2016 at 19:56 UTC
    The script has to work on windows, so looking for files in /sys/class/net is not an option sadly. I'll try to look in the IO::Interface::Simple module though.