Link to home
Start Free TrialLog in
Avatar of micromarch
micromarch

asked on

how to shuffle an array in perl

Hi experts. I am trying to make a program with perl to shuffle an array. It is basically a card game. I am using pop, shift and push functions in order to do this but not too sure how. Help would be greatly appreciated thanks.
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of micromarch
micromarch

ASKER

yeh that works but my co-workers want me to use push,shift and pop.
why would they want you to do that?
would your co-workers allow you to use an auxilliary array?
you could implement the slice using push and shift
what do they mean by returning an element for example the pop function? i can return the element i removed somewheres else?