note
amitbhosale
To find the mac addresses of active network interface cards on the current machine,
you can use the (non-standard) [mod://Net::Interface] module:
<code>
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";
}
</code>
166645
166645