in reply to Re^2: I have it working, but sorting is very greedy.
in thread Need help with searching flatfile and updating it.

Sounds like you could use a hash.

my %browsers = (); foreach ($line) { # eg '12|netscape' $browsers{(split(/|/))[1]} = (split(/|/))[0]; } print sort { $browsers{$a} <=> $browsers{$b} } keys %browsers;

UPDATE: Looks like it's getting late... the var in the foreach loop should be $_, not $line (fixed), thereby providing for the implicit split.