in reply to sort after split
To do that, you need to save them all and then sort them, something like this:
(untested, and making some guesses about what you want)while (my $entry = <DB>) { chomp(my @fields = split(/\t/, $entry)); push @records, \@fields; } @records = sort { $a->[1] cmp $b->[1] } @records; for my $fields (@records) { print <<ENDHTML; <li><a href="#$fields->[0]">$fields->[0] ($fields->[1])</a></li> ENDHTML }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sort after split
by lakeTrout (Scribe) on Dec 06, 2007 at 19:05 UTC |