in reply to Re: Attempt to free unreferenced scalar...
in thread Attempt to free unreferenced scalar...
foreach $key (keys %hash) {
}
with another foreach loop inside using the same variable name and same hash
foreach $key (keys %hash) {
foreach $key (keys %hash) {
}
}
Incidentally, this only caused the problem in strict mode. I'm not saying this simple loop would replicate the problem, I got it down to about 20 lines and still throwing the error. But if you're getting this error message, look for a nested thing like that, it might be what's causing it. Perl should maybe throw a warning when a loops are nested like that with the same variables, because otherwie it was pretty hard to track down in my 1000 line program, I had to remove piece by piece until it became evident.
|
|---|