Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by LanX (Canon)
on Dec 07, 2012 at 05:46 UTC ( #1007688=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      DB<103> @array=a..f
     => ("a", "b", "c", "d", "e", "f")
     
      DB<104> @array[0..0]
     => "a"
    
  2. or download this
      DB<106> @array = 1 .. 10;
     => (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
    ...
     
      DB<109> \%stats;
     => { 1 => 100, 2 => 101, 3 => 108, 4 => 108, 5 => 101, 6 => 103, 7 =>
    + 79, 8 => 98, 9 => 100, 10 => 102 }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2015-07-31 15:04 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 (278 votes), past polls