vit has asked for the wisdom of the Perl Monks concerning the following question:
Of couse I can write a sub, but I need to do it nice, something like:foreach ( sort { $scores{$b} <=> $scores{$a} } keys %scores )
I am making it up of course, just to explain what I want.$expr = (CONDITION) ? "$scores{$b} <=> $scores{$a}" : $scores{$a} <=> +$scores{$b}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Store operation in a variable
by Utilitarian (Vicar) on Aug 03, 2010 at 20:49 UTC | |
|
Re: Store operation in a variable
by BrowserUk (Patriarch) on Aug 03, 2010 at 21:12 UTC | |
|
Re: Store operation in a variable
by kennethk (Abbot) on Aug 03, 2010 at 21:01 UTC | |
|
Re: Store operation in a variable
by aquarium (Curate) on Aug 04, 2010 at 01:32 UTC | |
by vit (Friar) on Aug 04, 2010 at 02:53 UTC |