The probable cause is passing an empty array to shuffle:
shuffle([]);Suggested fix: my $i = @$array || return;
In reply to Re: Array shuffle code produces 'Modification of non-creatable array value attempted' error
by Anonymous Monk
in thread Array shuffle code produces 'Modification of non-creatable array value attempted' error
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |