Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11150803]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-25 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found