Damian Conway wrote:
> 
>    >    %professors{ $a->name cmp $b->name };
>    >
>    >    %students{ $$students{$b}{GPA} <=> $$students{$a}{GPA} };
> 
> These already mean something. Please don't "special-case" them.

No they don't.

[david@nicol1 perl]$ perl -le '%nums = (1..20); print %nums{1}'
Can't use subscript on hash deref at -e line 1, near "1}"
(Did you mean $ or @ instead of %?)
Execution of -e aborted due to compilation errors.


> Isn't this better handled with a (revamped and faster) tie?
> 
>         tie %professors, 'Tie::Sorted', ^a->name cmp ^b->name;
> 
>         tie %students, 'Tie::Sorted',
>                        $$students{^1}{GPA} <=> $$students{^0}{GPA} };
> 
> Damian


It's a shorthand for it.



-- 
                          David Nicol 816.235.1187 [EMAIL PROTECTED]
                                        Dan Sugalski for president

Reply via email to