in reply to Re^2: Parsing protocol data: unpack and bytes
in thread Parsing protocol data: unpack and bytes

$Config{shortsize} and $Config{longsize} are useless. Those are the sizes of those types your machine/compiler uses. You need the values from the remote machine, which you'll need to hardcode.

Similarly, I disagree with BrowserUK's use of s. You need to use the remote machine's byte order, so you need to use n or v. (Then you'll have to convert it from unsigned to signed, but that's easy: $ping = unpack('s', pack('S', $ping));.)