in reply to Global and autovivification?

I can't reproduce your problem with the code you gave us. I just added a print statement after the return $instance if defined $instance; line, and a at the end of the program a call to Encoder::Config::get_instance. The print statement is executed (and later it dies because it can't find method load_config, but that's expected).

So the problem is not in the part of the script that you showed us.

(In case you haven't already, make sure to use strict; to avoid unintentional magic).

Replies are listed 'Best First'.
Re^2: Global and autovivification?
by kalium (Sexton) on Nov 04, 2008 at 16:09 UTC
    I think I must've found out at the same time that it does print after the defined test (must've changed something somewhere else to fix that...), but it still does choke if it's put through the debugger. Which is a pain as I'm actually trying to test something else in the sub !
Re^2: Global and autovivification?
by kalium (Sexton) on Nov 04, 2008 at 16:22 UTC
    PROBLEM SOLVED. It turns out that it was a use statement causing me grief