Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Add a fixed number of unique elements to hash

by jo37 (Deacon)
on Mar 06, 2023 at 20:24 UTC ( [id://11150803] : note . print w/replies, xml ) Need Help??


in reply to Re^2: Add a fixed number of unique elements to hash
in thread Add a fixed number of unique elements to hash

Be careful with List::AllUtils. "All" isn't really "all". At least frequency from List::MoreUtils is missing. I prefer to use the original modules.

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Replies are listed 'Best First'.
Re^4: Add a fixed number of unique elements to hash
by tybalt89 (Monsignor) on Mar 06, 2023 at 21:57 UTC

    Probably because of

    use List::AllUtils qw( count_by ); %frequencies = count_by { $_ } LIST;