in reply to Network interface discovery

Try the findalldevs method in Net::Pcap.

Replies are listed 'Best First'.
Re^2: Network interface discovery
by moot (Chaplain) on Apr 23, 2005 at 22:08 UTC
    That sounded ideal, but sadly my Net::Pcap does not define findalldevs, although it is present in libpcap:
    $ perl -MNet::Pcap -e 'Net::Pcap::findalldevs()' Can't locate auto/Net/Pcap/findalldevs.al in @INC $ perlver Net::Pcap 0.04
      You could try a newer version of Net::Pcap; the documentation on CPAN says this function is supported in 0.05.
        Interesting.. CPAN fed me the 0.04 version.

        Anyway, 0.05 is getting there, although the function only returns the network names, and Net::Pcap::lookupnet() returns the network, not the address.. e.g. for 127.0.0.1 it returns 127.0.0.0. So it's not quite what I needed, but thanks for the pointer. I'll keep digging..