in reply to sort after split

It sounds like you what you've tried is sorting the fields for each logfile.log record, when what it sounds like to want to do is sort the records themselves.

To do that, you need to save them all and then sort them, something like this:

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 }
(untested, and making some guesses about what you want)

Replies are listed 'Best First'.
Re^2: sort after split
by lakeTrout (Scribe) on Dec 06, 2007 at 19:05 UTC
    BINGO! Thanks ysth!

    After some minor tweaking I have it working beautifully now. Thanks to you and everyone else. have a good day!

    LakeTrout