in reply to "eval" and "my" variable weirdness

Forget this. I have no idea why adding a statement AFTER the eval would suddenly make it work.In my Windows ActiveState Perl 5.8.7 it works without errors, ... sort of.

The result is "thingy one is" because you have included curved brackets around the key value!. So if I change my $key = '{One}'; to my $key = 'One';, the result isbecomes "thingy one is 1->One". So clearly your eval is not doing what you think it is doing.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Replies are listed 'Best First'.
Re^2: "eval" and "my" variable weirdness
by splinky (Hermit) on Jun 29, 2006 at 16:08 UTC
    The curlies are intentional. In my actual app, $thingy points to a complex data structure, and $key could be something like {One}[5]{France}. That's why I'm using eval with a string instead of a block.