in reply to sorting a file
because of the way sort works there are _some_ more split calls, but it should work fine for short files. perhaps caching the once split person names boosts this a little bit. i noticed that using Devel::DProf breaks the code in some way?! is there a known issue?use strict; use Tie::File; my @array; tie @array, 'Tie::File', 'test.data'; @array = sort {(split / /, $a)[1] cmp (split / /, $b)[1]} @array; untie @array;
|
|---|