in reply to Sorting issues
#!/usr/bin/perl -w use strict; my @database = <DATA>; sub g($) {(split/\|/,shift)[$#_]} my @sorted = sort {g$a<=>g$b} @database; print @sorted; __DATA__ a|b|c|10 d|e|f|g|h|9 i|100 j|k|2 l|m|n|o|11
"Argument is futile - you will be ignorralated!"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Sorting issues
by blue_cowdawg (Monsignor) on May 28, 2001 at 02:26 UTC | |
by larryk (Friar) on May 28, 2001 at 14:11 UTC |