Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I guess I am stuborn. I have read several of the posts whihc explain this error. I guess I am missing a key point somewhere. What is different about "$itme" when used in the example below. It seems to me that it is always a constant.
test5:{ @list = ("abcdef", "ghijkl", "Dumbo"); foreach $item ("abcdef", "ghijkl", "Dumbo" ){ #This fails "modify +ing a Read only Constant" # foreach $item (@list ){ # this works $item =~ s/abc/zzzzzz/ ; print (" $item \n"); } }
|
|---|
| Replies are listed 'Best First'. |
|---|