I've recently written a program where I needed to get the
MAC address of a local interface. I used an ioctl call, with
SIOCGIFHWADDR as second parameter. This was in C,
but Perl also has an ioctl function - or you could write a
piece of XS code to do it for you.
Abigail