Hello fellow perl users,
I currently try to find a way to get information about my local network interfaces. To be more precise, I want to know which one of my network interfaces is a real (physical) or a virtual one. I don't had my eyes on the Net::Interface module, but apparently my ppm won't find the package at all. Additionally, I don't really know if the Net::Interface module can distinguish between physical and virtual network interfaces. Is there a way to get the information without the usage of that package?
Edit: For anyone interested, I found a solution:
my $dbh = DBI->connect('dbi:WMI:'); my $stmt = " SELECT Name, NetConnectionID FROM Win32_NetworkAdapter WHERE Manufacturer != 'Microsoft' AND NOT PNPDeviceID LIKE 'ROOT\\\\%' "; my $sth = $dbh->prepare($stmt); $sth->execute(); while (my @row = $sth->fetchrow_array) { print "Name:\t\t\t$row[0]\Interface:\t$row[1]\n\n"; }
In reply to Trying to get information about network interfaces by iRemix94
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |