Another problen with your code is that you are modifying @random_card while you are iterating over it in a foreach loop which will cause problems. As it says in perlsyn: "If any part of LIST is an array, "foreach" will get very confused if you add or remove elements within the loop body, for example with "splice". So don't do that."
In reply to Re: Perl subroutine update
by jwkrahn
in thread Perl subroutine update
by craziestfire73
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |