Non-perl solution, but if this is something you need to do often I recommend running arpwatch on a machine that is always connected to the network. You can then simply retrieve the IP address under which a given MAC last showed up from the arpwatch database.
Alternatively (if you really just want to do this once), you can use the arping utility to check every IP address on your network segment until you get a response with the matching MAC address. This puts less load on the network than similar solutions using nmap or ICMP ping because only the initial ARP request is sent and no further packets (this also means it's a lot faster on large networks). arping also has an option to search for a MAC address directly, but that relies on the host in question to respond to an ICMP broadcast ping, which many hosts will not be configured to do.
|