in reply to Dynamic sort criteria for an Array in Perl

Once you have the string, you can always use eval to turn it into code:
my $sub = eval "sub { $buildString }"; my @sorted = sort $sub @unsorted;

Be very careful, though; don't let the user run arbitrary code. Also note that debugging such code is hard.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ