I think you need to read the perldoc for the rand() function:
linux> perldoc -f rand
perl -e '@choices = qw|a b c d e|; print rand(@choices) . qq|\n|;' 0.785222268100387
It doesn't return a random element from your list.
Since your question reads so much like homework I'll leave you with this:
Celebrate Intellectual Diversity
In reply to Re: Where is the zero coming from?
by InfiniteSilence
in thread Where is the zero coming from?
by Pauleduc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |