in reply to Re^2: sorting string
in thread sorting string

Yes, after posting my response it hit me that your question simply didn't ask what you wanted answered.

Zaxo has it right; you probably want a hash with key/value relationship. Then you ultimately want the strings stored as keys, and the computed values as values associated with the keys. ...something like this:

use strict; use warnings; my %strings; # Set up some example key/value relationships. Your method # for populating the hash will be more complex, but isn't # defined in the question. $strings{"Here is one string"} = 233; $strings{"Here is another string"} = 151; $strings{"Here is yet another"} = 322; print map{ "$_ = $strings{$_}\n" } sort{ $strings{$b} <=> $strings{$a} } keys %strings;

Dave