in reply to Uses of eval (sorting and tablematrix tags)

Running the eval inside the comparison function is pretty inefficient. A better aproach is to compile $sort_str into a sub and call it from the comparison block or just wrap the sort also inside the eval:
foreach $jrow (eval "sort { $sort_str } keys %\$ref_spv") {...}

Besides that, for that particular task you can use Sort::Maker or Sort::Key that create efficient sorting functions from a description of the keys. For example:

my $sorter = Sort::Key::multikeysorter(sub { @{$ref_spv->{$_}}{qw(Symb +ol Sel120 Sel119)} }, qw(String String -Int)) foreach $jrow ($sorter->(keys %$ref_spv)) { ... }

Replies are listed 'Best First'.
Re^2: Uses of eval (sorting and tablematrix tags)
by merrymonk (Hermit) on Aug 30, 2011 at 13:13 UTC
    Thanks for those comments. I did not know you could improve things in the way you suggested. I may well be able to use that elsewhere.
    Also it was good to hear of the sort modules that I have to come across before now.