in reply to Re: Numeric sorting WITHOUT <=>in thread Numeric sorting WITHOUT <=>
my ($min) = keys(%jetsons); This is the number of keys in %jetsons.
Actually, it's a randomly (insofar as the hashing algorithm is random) chosen key from the hash. The assignment is in list context and seeds the min/max finder loop that follows.
>perl -wMstrict -le
"my %jetsons = qw(aa 1 bb 2 cc 3 dd 4 ee 5);
my ($min) = keys %jetsons;
Update: ikegami's code works. (Never doubt a Pope.)
# keys in scalar context: Number of keys.
my $min = keys(%jetsons);
# keys in list context: List of keys. First one is assigned
my ($min) = keys(%jetsons);
DejaVu Sans Mono
Droid Sans Mono
Envy Code R
Source Code Pro
The default, whatever it is
Results (67 votes). Check out past polls.