Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Length of array in hash of arrays

by ambrus (Abbot)
on May 12, 2013 at 08:50 UTC ( #1033179=note: print w/ replies, xml ) Need Help??


in reply to Re: Length of array in hash of arrays
in thread Length of array in hash of arrays

Yes, I'm aware of that. That's why this is post is in Obfuscated Code rather than Meditations. If you want to get the real solution, the simpler

use 5.012; no warnings; my @t = map { rand } 1..60; my %g = (k => \@t) +; for my $n (0..1e3) { (my $s = $n) =~ y/0-9/ {}@#$%=^~+/; my $c= qq( +${s}g{k}}); if (60 == eval $c) { warn $c; } }
prints it together with another fake solution.


Comment on Re^2: Length of array in hash of arrays
Download Code
Replies are listed 'Best First'.
Re^3: Length of array in hash of arrays
by Anonymous Monk on Jul 05, 2013 at 16:58 UTC

    The simplest way must contain the function 'length':

    length(!()x@{(\%x)->{k}})

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (14)
As of 2015-07-31 17:06 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 (279 votes), past polls