OK, I understand the difference between a variable and a constant. But my problem is that I can't grasp exactly when Perl decides which one it is. My thoughts are..."abcdef" is a constant of type string. It looks like in both cases, it is eventually assigned to $item. If it is assigned to a element of @list first, then assigned to $item in the foreach statement, it still seems that $item contains a string. It seems like in the end, $item contains the same thing. Now does this have somehting to do with $_ and is the error msg really refering to $_ as the Read Only constant?
In reply to Re: Still don't undersand "Modification of a read-only value attempted" error
by Dan.Pinvidic
in thread Still don't undersand "Modification of a read-only value attempted" error
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |