in reply to Read-only variable in foreach loop?

Your variables $1, $2, etc are read-only variables. In the foreach loop the $i is really a direct reference to $1 .. $5. So by modifying $i you are really trying to modify $1 .. $5, and you cannot do that. Here is an example:
$_ = "##"; m/(##)/; $1 = "Hello"; Modification of a read-only value attempted at - line 3.
To Fix your problem copy the read-only values to writeable variables:
@list = ($1, $2, $3, $4, $5); foreach $i (@list) { $i = int rand( @numb +1 ); pop @numb; }