in reply to (cLive ;-)(Golf) Analyzing Time From tcpdump Output
in thread (Golf) Analyzing Time From tcpdump Output
I'm afraid your solution has a bug; the greedy matching of .* means that $2 only contains one of the digits before the decimal point, rather than both. Here's another way to match:
perl -lp0e'/([\d.]{9}).*([\d.]{9})/s;$_=$2-$1'
Using -l is shorter than using $:, and avoids outputting a spurious '-' after the newline. :)
In Section
Meditations