I can't see anything blatantly wrong. But looking at your node, several questions come up:
Why not make %config set inside _fill_config?
If the only way to set %config is by calling _fill_config, why don't you set %config directly in there?

Are you using AutoLoader/SelfLoader/load?
If you are, and _change_config/_fill_config are in the area that's not always loaded, they will not see the "same" package lexical (it will be a package global to them).

Why the flattening?
You realize of course that if you're returning a hash, you're essentially flattening it to a list and return that. From an effieciency point of view, it's much better to return a reference to a hash (and probably have the package lexical $config be a reference as well).

Are you sure _parse_file works ok?
Double check in _fill_config that actually the thing you expect, is being returned.

I think there are other things going on in your example that I find strange. But for now I'll attribute those to the making of the (pseudo) takeout.

Hope this helps

Liz


In reply to Re: Changing package variable via object-instance by liz
in thread Changing package variable via object-instance by BioHazard

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.