Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.
Moderator: Moderators
einbroch
Human
Posts: 21 Joined: 14 May 2011, 10:22
Noob?: Yes
#1
Post
by einbroch » 17 Jun 2011, 21:03
Whenever I call $Settings::control_folder it just outputs a blank string how do i fix this. I tried to display it like this:
Code: Select all
message("$Settings::control_folder","system");
I get no path, and no errors.
EternalHarvest
Developers
Posts: 1798 Joined: 05 Dec 2008, 05:42
Noob?: Yes
#2
Post
by EternalHarvest » 18 Jun 2011, 01:51
No idea where you've got this from (there's only an unrelated comment mentioning it in trunk now). There's &Settings::getControlFilename, &Settings::getControlFolders etc, just look in Settings.pm.
einbroch
Human
Posts: 21 Joined: 14 May 2011, 10:22
Noob?: Yes
#3
Post
by einbroch » 18 Jun 2011, 09:06
Hi,
I got it from
functions.pl Line 131: , rev: 7791
Code: Select all
sub loadDataFiles {
# These pragmas are necessary in order to support non-ASCII filenames.
# If we use UTF-8 strings then Perl will think the file doesn't exist,
# if $Settings::control_folder or $Settings::tables_folder contains
# non-ASCII characters.
....
}
I tried
Code: Select all
message("$Settings::getControlFolders","system");
doesn't give me any output but for the
logs folder i get an output and its correct when i do this:
Code: Select all
message("$Settings::logs_folder","list");
EternalHarvest
Developers
Posts: 1798 Joined: 05 Dec 2008, 05:42
Noob?: Yes
#4
Post
by EternalHarvest » 18 Jun 2011, 09:38
It's a function, not a variable.
Code: Select all
use Data::Dumper; message Dumper Settings::getControlFolders;
einbroch
Human
Posts: 21 Joined: 14 May 2011, 10:22
Noob?: Yes
#5
Post
by einbroch » 18 Jun 2011, 12:08
Oops, yeah 'get' is supposed to be a function
However I get a weird output from this:
Code: Select all
my $controlFolder = Settings::getControlFolders;
message("$controlFolder","system");
Output:
I am expecting path to control folder
EternalHarvest
Developers
Posts: 1798 Joined: 05 Dec 2008, 05:42
Noob?: Yes
#6
Post
by EternalHarvest » 18 Jun 2011, 18:35
Just as expected when evaluating any array in scalar context in Perl - result is the number of items.
einbroch
Human
Posts: 21 Joined: 14 May 2011, 10:22
Noob?: Yes
#7
Post
by einbroch » 19 Jun 2011, 01:39
Oops my bad, got it.
Code: Select all
my @controlFolders = Settings::getControlFolders;
message("$controlFolders[0]","system");