It would appear that the output from hping is fully buffered when piped to perl for further line-by-line processing, so piping hping to perl doesn't work.
hping --icmp-ts example.ca | perl -ne 'if (/Originate=(\d+) Receive=(\d+) Transmit=(\d+)/) { ($o, $r, $t) = ($1, $2, $3); } if (/tsrtt=(\d+)/) { print $r - $o, " ", $o + $1 - $t, "\n"; }'
How do I change hping from being fully buffered to being line buffered when piped?
Not a duplicate of the following question, since no solution works in OpenBSD base: