in reply to Accessing NIC/mac address ?
I haven't tested this code, but I am pretty sure that would do it. And if it is an NT machine you would just do something similar with ipconfig instead. Note you should replace fxp0 with the name of your network device. Update: I just tested the code and it worked.open (READ, "ifconfig fxp0 |") or die "$!"; while (<READ>) { chomp; if (/ether/) { s/^\s+//; my $mac = (split)[1]; } } close READ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Accessing NIC/mac address ?
by earthboundmisfit (Chaplain) on Feb 14, 2002 at 17:26 UTC | |
by Rex(Wrecks) (Curate) on Feb 14, 2002 at 17:50 UTC | |
by earthboundmisfit (Chaplain) on Feb 14, 2002 at 18:19 UTC | |
|
Re: Re: Accessing NIC/mac address ?
by rob_au (Abbot) on Feb 15, 2002 at 03:50 UTC |