Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: List all network interfaces on the local machine?

by rob_au (Abbot)
on May 15, 2002 at 06:12 UTC ( #166653=note: print w/replies, xml ) Need Help??


in reply to List all network interfaces on the local machine?

For *NIX-type platforms, there is the IO::Interface module which allows local interfaces to be enumerated via additional methods added to IO::Socket objects. These methods allow interface information to be both retrieved and modified.

For example ...

use IO::Interface; use IO::Socket; my $sock = IO::Socket::INET->new( 'Proto' => 'udp' ); foreach my $iface ( $sock->if_list ) { print $iface, " ", $sock->if_addr, "/", $sock->if_netmask, "\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://166653]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2022-10-07 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (30 votes). Check out past polls.

    Notices?