Think about Loose Coupling | |
PerlMonks |
Re: Idiom to return 0 or random number of array elementsby LanX (Saint) |
on Dec 07, 2012 at 05:48 UTC ( [id://1007690]=note: print w/replies, xml ) | Need Help?? |
just include the possibility of @array[0..-1] which returns an empty list. try something like: @array[0 .. (int rand (@array+1)) -1]
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|