Nice solution! But a couple of questions:
It would be interesting to benchmark if using unshift() into the
$hashrefs array would be more or less efficient than messing with
$i. If nothing else, it would be two lines shorter, and more Perlish.
And perhaps this is too early in the morning, but why are you splicing by -4, and then popping
@data?
It's Sunday morning where I am, and I'm too lazy to try to write a coherent benchmark...
--Chris
e-mail jcwren