Oh, the original code does what I want it to do already. Unfortunately the warning pops up. Your version circumvents the warning, but in a way that is not helpful to me, because it cannot be applied to the real code. A little less compact version of the actual code would be:

package Get::Me::My::Config; use Config::Std; sub get_config { read_config _file_name() => my %config; return \%config; } package Database::Stuff; use base q(Rose::DB); use Get::Me::My::Config; sub init_db { my $db_conf = Get::Me::My::Config->get_config->{db_conf}; return _create_db_from($db_conf); }
Something like this. Now to apply your changes, I would need to change the lexical into a package global, which simply is not what I intended for this variable to be at this place.

In reply to Re^4: Config::Std to lexial in BEGIN { } throws warning? by gorash
in thread Config::Std to lexical in BEGIN { } throws warning? by gorash

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.