int rand (@arr) will get you a random index for in @arr's range, and then you can just print it out with $arr[int rand (@arr)]
E.G.:
perl -le '@arr = 10..19; print $arr[int rand@arr]'
In reply to Re: Choose random element of array?
by kesterkester
in thread Choose random element of array?
by McMahon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |