in reply to Re: How can I sort this data on the first field
in thread How can I sort this data on the first field
use strict; use warnings; print "Content-type: text/html\n\n"; my %someData; while(<DATA>) { chomp(); (my $key, my $value) = split(/\|/, $_, 2); $someData{$key} = $value; } foreach (sort { $a <=> $b } keys %someData) { print "$_\{$someData{$_}\}\n"; } __DATA__ 30|microsoft 70|aol 76|netscape 5|trouble? 35|mozilla 40|opera 100|FireFox
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: How can I sort this data on the first field
by Chady (Priest) on Apr 26, 2005 at 06:19 UTC |