http://www.perlmonks.org?node_id=1064802


in reply to Faster Hash Slices

You could win a little time by not copying your data twice : @{$ref}{@head} = split(/\t/); (which will even make split a little faster if you put the result in less elements than there are tab separated values in your string).

Or you could keep the array, and access its elements with constants, like was done here for example (it's done on a blessed arrayref in this case, but it works all the same).