in reply to Uses of eval (sorting and tablematrix tags)
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 |