in reply to net::pcap performance

It's not easy to start testing the code you show. You're using too many other modules that you are not saying what they are (e.g. NetPacket::IP is obvious, but probably also Net::PcapUtils, ... what else?).

Some other things it would be nice to know:

How big is the input file (both number of bytes and number of packets)?

What was the snapshot length (i.e., the number of bytes captured for each packet)? Was it the default? Was it full packets? Something else?