in reply to Array shuffle code produces 'Modification of non-creatable array value attempted' error

The probable cause is passing an empty array to shuffle:

shuffle([]);
Suggested fix:   my $i = @$array || return;

  • Comment on Re: Array shuffle code produces 'Modification of non-creatable array value attempted' error
  • Select or Download Code