Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Idiom to return 0 or random number of array elements

by eyepopslikeamosquito (Canon)
on Dec 07, 2012 at 10:31 UTC ( #1007707=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $stats{ scalar( x() ) }++
    
  2. or download this
    $stats{ x() }++
    
  3. or download this
    $stats{ scalar( my @r = x() ) }++
    
  4. or download this
    use strict;
    use warnings;
    ...
    my %stats;
    $stats{ scalar( my @r = x() ) }++ for  1 .. 1000;
    print Dumper( \%stats );
    
  5. or download this
    $VAR1 = {
              '6' => 81,
    ...
              '1' => 123,
              '10' => 117,
              '5' => 108
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2014-09-21 02:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (166 votes), past polls