Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by LanX (Saint)
on Dec 07, 2012 at 05:46 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1007688]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-03-19 05:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found