Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: List all network interfaces on the local machine?

by amitbhosale (Acolyte)
on Jun 13, 2008 at 10:12 UTC ( [id://691870]=note: print w/replies, xml ) Need Help??


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

To find the mac addresses of active network interface cards on the current machine, you can use the (non-standard) Net::Interface module:
use Net::Interface qw( mac_bin2hex ); my @all_ifs = Net::Interface->interfaces; print "Mac addresses of ethernet interfaces on this machine:\n"; for ( grep { $_->name =~ m/^eth\d/ } @all_ifs ) { print mac_bin2hex( scalar $_->hwaddress ),"\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (1)
As of 2024-07-23 04:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.