in reply to How can I sort this data on the first field

If i understood your question correctly, is this you want,

while(<DATA>) { chomp; @cpy=(); @cpy = split(/\|/); $cpy{$cpy[0]} = [@cpy]; } print "$_->[0]\t$_->[1]\n" for sort {$a->[0] <=> $b->[0]} values %cpy;
output: 30 microsoft 35 mozilla 40 opera 70 aol 76 netscape

updated:

Prasad

Replies are listed 'Best First'.
Re^2: How can I sort this data on the first field
by Anonymous Monk on Apr 25, 2005 at 07:08 UTC
    Thank you very much Prasad!