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
In reply to Re: How can I sort this data on the first field
by prasadbabu
in thread How can I sort this data on the first field
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |