title: How can I take n elements at random from a Perl array?
body: <p>I have an array, <code>A = [a1,a2,a3,...aP]</code> with size <code>P</code>. I have to sample <code>q</code> elements from array A.</p>
  
  <p>I plan to use a loop with <code>q</code> iterations, and randomly pick a element from A at each iteration. But how can I make sure that the picked number will be different at each iteration?</p>