for_list is certainly useful, and even for arrays. But in this case it's reasonably clear, and more concise to just use traditional pre-5.36 Perl.
my %h = map { $_, rand } 'a'..'z'; print "$_ => $h{$_}\n" for sort keys %h;
Dave
In reply to Re: for_list and sorting key/value hash pairs
by davido
in thread for_list and sorting key/value hash pairs
by ibm1620
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |