Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-07-31 01:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (242 votes), past polls