in reply to Sorting issues
This sorts it properly. I'm sure there's a better way to get at that last number, but I'm just stripping out anything that's not a digit.my @sorted=sort{ my $one=substr($a,rindex($a,'|')); my $two=substr($b,rindex($b,'|')); $one =~ s/\D//g; $two =~ s/\D//g; ($one <=> $two) } @database;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Sorting issues
by merlyn (Sage) on May 27, 2001 at 18:17 UTC |