Don't modify an array over which you are iterating using foreach. You actually want while (@deck) here anyway. It will produce a really bad shuffle, though. To shuffle a list or array, one normally uses List::Util's shuffle.
Use use strict; use warnings;!!! You forgot to limit the scope many variables.
In reply to Re: array shuffle
by ikegami
in thread array shuffle
by boom.roasted
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |