in reply to Re: sort hash exceptions
in thread sort exceptions

The exists() aren't really necessary.
sub except_sort { $except{$a} || -$except{$b} || ($a cmp $b) }

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: Re: sort hash exceptions
by ysth (Canon) on Jan 26, 2004 at 23:01 UTC
    That gives "Use of uninitialized value in negation (-)". (Yes, I know, the example you responded to was missing use warnings;), so you need -($except{$b}||0) instead.