my @sorted=sort{my $one=substr($a,rindex($a,'|')); my $two=substr($b,rindex($b,'|')); ($one <=> $two) } @database;
This block of code takes my tiny pipe-deliminated database and sorts it by the number in the last field. When it gets to 100, it puts it right in front of the 10. This data comes from a flat file database (don't flame me. I've been over all that about flat files enough.) The number is the last field, so it is possible it has a new line character attached. That's the only thing I can think of that would cause that. I don't know where to put a chomp in this block though.
Anyone else got any ideas? I am totally stumped and could use any help I can get on this.
-Stamp_Guy
In reply to Sorting issues by Stamp_Guy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |