in reply to Sorting a File which contains numbers
If you're on *ix, use the system sort utility (sort -n). If you're on Windows, its sort command doesn't seem to have a numerical option (see sorting in XP).
As an aside, you'll likely get much better response from the Monks if you, first, show what you've tried (in this case, seemingly, nothing), and, second, don't ask for code.
Oh, and a hint:
@out = sort { $a <=> $b } @in; # to sort array @in numerically, and pu +t it into @out.
emc
At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.
—Igor Sikorsky, reported in AOPA Pilot magazine February 2003.
|
|---|