IP packets have no concept of MAC address. That's already been removed by the OS by the time you get the packet. There are few ways to get that information at this point:
- Checking the ARP table would be the easy way, but you don't want to do that.
- Using libpcap would be the more reliable way, if you don't trust the source IP address, but you don't want to do that.
- Writing your own ethernet driver in Perl might work, but if you don't want to filter packets with pcap, you're certainly not going to want to write a complete driver.
Now that you've eliminated the reasonable answers, my question is: What are you
really trying to accomplish? I suspect there's a much easier way to do what you want.