in reply to Re^3: Config::Std to lexial in BEGIN { } throws warning?
in thread Config::Std to lexical in BEGIN { } throws warning?
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:
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.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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Config::Std to lexial in BEGIN { } throws warning?
by MidLifeXis (Monsignor) on Feb 23, 2010 at 18:29 UTC | |
by gorash (Novice) on Feb 23, 2010 at 18:52 UTC |