in reply to Re: fast string parser: regex versus substr
in thread fast string parser: regex versus substr
I think you'd be better off using the "x" template to ignore the third field (with index 2):my ($jcpu,$j,$s)=(unpack('@2A16A40A232A16', $line))[0,1,3];
my ($jcpu,$j,$s)= unpack('@2A16A40x232A16', $line);
You can replace the leading '@2' with 'x2'', too. Or, just the reverse, replace the 'x232' with '@290'. I don't think it'll make much difference speedwise.
|
---|