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. :)
|
---|
Replies are listed 'Best First'. | |
---|---|
(cLive ;-)(Golf) Analyzing Time From tcpdump Output
by cLive ;-) (Prior) on Feb 05, 2002 at 07:45 UTC | |
by chipmunk (Parson) on Feb 05, 2002 at 16:00 UTC |
In Section
Meditations