in reply to Re: Numeric sorting WITHOUT <=>
in thread Numeric sorting WITHOUT <=>
One may not know the minimum & maximum values without inspecting to use range operator, so ...
use strict; use warnings; use List::MoreUtils 'minmax'; my %hash = ( ... ); # Absurdity is to find end values in order to avoid # numeric comparison. my ( $min , $max ) = minmax keys %hash; for my $i ( $min .. $max ) { ... }
|
---|
In Section
Seekers of Perl Wisdom