in reply to How to read pcap data from stream not from files.

Generally, you can use read or sysread to read an arbitrary number of bytes from a stream.

Alternatively, you can set $/ to a ref-to-number, e.g.

$/ = \128;

to have <> read blocks of 128 bytes (or less, in case 128 aren't available).

I'm not intimate enough with the pcap format, though, to tell what block size would be adequate, and if the format is streamable at all (not every format is...).