in reply to sorting arrays

On Unix a simple alternative to perl is to use the system's sort command:

% sort -uk 1,1 datafile > sorted_datafile
That will sort strictly (i.e. no duplicates) on the first field; the first instance encountered is the one kept. See man sort (or info sort if your system uses GNU's sort).

the lowliest monk

Replies are listed 'Best First'.
Re^2: sorting arrays
by strictvars (Sexton) on Apr 12, 2005 at 20:39 UTC
    Hash slices would be ok too.
    my %hash; @hash(@array) = (@array); @sorted = keys %hash;