In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Mike Blezien) writes: >Gunnar Hjalmarsson wrote: >> Mike Blezien wrote: >> >>> What does this type of error indicate, I never encountered this type >>> of error before. >>> >>> Modification of a read-only value attempted at >>> /home/www/cgi/somescript.cgi line 151. >>> >>> <code snip> >>> my($sparam); >>> >>> foreach $sparam (param()) { ${$sparam} = param($sparam); } # line 151 >> >> Maybe it's that; hard to tell since you don't give more context. But >> what you are trying to do, i.e. using symbolic references, is >> unnecessary and considered bad programming practice. [snip] >Thanks for the suggestion. We've used this type of coding scheme before with no >problems in the past, but wasn't aware it was considered "bad programming" >practice.
Since it caused you an error you didn't understand, you now know one of the reasons why :-) Consider what that line would do if you had a parameter with the name "1" (digit one). You should *always* "use strict" in your code. -- Peter Scott http://www.perldebugged.com/ *** NEW *** http://www.perlmedic.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>