in reply to problem in sorting hash by value

use strict and warnings. And don't nest your subroutines like that unless you know what you're doing and want to create closures on purpose. You might be using strict (I can't absolutely tell), but you're not using warnings, because you have a problem with that $key variable in the foreach loop not staying shared (its declared in a sub in an outer scope but being used in a sub in an inner scops).

Replies are listed 'Best First'.
Re: Re: problem in sorting has by value
by Anonymous Monk on Dec 11, 2001 at 20:16 UTC
    you're right I am using strict, but not warnings (dunno how). If you have time could you elaborate your comment about outer/inner scopes?