in reply to Config::Std to lexical in BEGIN { } throws warning?
I believe that %config goes out of scope at the end of the BEGIN block. When the BEGIN block completes, DEMOLISH is able to be called, because %config has just gone out of scope. Now, whenever you are using %config in the rest of your application, I am not certain where the data is coming from.
If you move my %config outside of the BEGIN block, and then change the read_config line to read_config "main.conf" => %config, it should take care if the problems, and you will actually have the data from your configuration file used by the application.
This would have been told you if you had done a use strict; use warnings; before the BEGIN block.
It is said that "only perl can parse Perl." I don't even come close until my 3rd cup of coffee. --MidLifeXis
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Config::Std to lexial in BEGIN { } throws warning?
by gorash (Novice) on Feb 23, 2010 at 17:23 UTC | |
by MidLifeXis (Monsignor) on Feb 23, 2010 at 17:31 UTC | |
by gorash (Novice) on Feb 23, 2010 at 17:54 UTC | |
by MidLifeXis (Monsignor) on Feb 23, 2010 at 18:29 UTC | |
by gorash (Novice) on Feb 23, 2010 at 18:52 UTC |