http://qs321.pair.com?node_id=11111672


in reply to Eval/package question

You already got the answer from GrandFather, but here's another way to see what's happening:

print("$items{3}{Value} = 2;"); eval("$items{3}{Value} = 2;");
That way you'll see exactly what eval receives as an argument.

Why are you using eval in the first place? String eval means the code isn't compiled until the very last moment, so if you introduce some mistake like a syntax error, you wouldn't get notified until you execute the bit of code that contains the eval (which might not be everytime). If you're trying to catch errors, using a block eval (eval { $value =  2; }) lets perl compile the code rightaway, but only execute the section separately

Edit: corrected my code tags thanks to choroba's sharp vision :P