in reply to fast string parser: regex versus substr
I came up with.
And it won the benchmark competition :-)sub dopack { foreach my $i ( 0..$#data ) { my $line=$data[$i]; my ($jcpu,$j,$s)=(unpack('@2A16A40A232A16', $line))[0,1,3]; warn "$jcpu $j $s"; # ..store the values in a hash, but that is not important here } }
I never really understood pack and unpack, but
it am getting to like it.
---------------------------
Dr. Mark Ceulemans
Senior Consultant
BMC, Belgium
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: fast string parser: regex versus substr
by bart (Canon) on Nov 20, 2003 at 22:24 UTC |