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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.