Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: length or array in a hash

by karlgoethebier (Vicar)
on Nov 10, 2012 at 16:39 UTC ( #1003268=note: print w/ replies, xml ) Need Help??


in reply to Re: length or array in a hash
in thread length or array in a hash

#!/usr/bin/perl + + use strict; use warnings; my %hash = ( one => [1], two => [ 2, 2 ], three => [ 3, 3, 3 ], ); for ( sort { $hash{$a} <=> $hash{$b} } keys %hash ) { print qq($_\t) . scalar( @{ $hash{$_} } ) . qq(\n); } print qq(\nVariatio delectat.\n);

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»


Comment on Re^2: length or array in a hash
Download Code
Replies are listed 'Best First'.
Re^3: length or array in a hash
by ongaku (Initiate) on Nov 14, 2012 at 19:26 UTC
    Thanks to all who replied and helped me out.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (15)
As of 2015-07-30 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls