I recently came a across a problem with an application that was saving configuration data as a hash in a file and using eval to load the data back. The problem was someone had created new entries by hand and had created duplicate keys. When I was running the code through the debugger, I could see that some keys were not being loaded into the hash, the duplicates were there. But I was missing some others.
I have 2 questions
My question is there some way of catching this error?
Can someone explain what was happening internally, that some hash entries where dropped?
its using Data::Dumper to save the hash and when it restore the data it slurps the file into a string and then executes %hash = eval $line
In reply to eval question by jhuijsing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |