Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Idiom to return 0 or random number of array elementsby BrowserUk (Patriarch) |
on Dec 07, 2012 at 05:37 UTC ( [id://1007687]=note: print w/replies, xml ) | Need Help?? |
I can then extend that to return a random number of elements: @array[0 .. int rand @array];. But I need to also sometimes get 0 elements. That will return 0 elements approx. 10% of the time:
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|