Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Array shuffle code produces 'Modification of non-creatable array value attempted' error

by Anonymous Monk
on May 29, 2015 at 19:42 UTC ( [id://1128337]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1128337]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-18 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found