Hey folks,
I've been sifting through the config_parse.pl and majordomo code,
trying to figure out just how this thing works, and I am getting stumped
by a particular function call:
In majordomo, the script that resides in the majordom homedir, several
of the do* functions have this line of code in them:
&get_config($listdir, $clean_list, "locked")
if !&cf_ck_bool($clean_list, '', 1);
What confuses me is the function call to &cf_ck_bool();
The function call has three arguments, the second of which is null
or nothing, the third of which doesn't mean anything.... or so it seems.
Here's the function definition of cf_ck_bool():
------
# get the boolean value. Return true if not the number 0 or null.
sub main'cf_ck_bool { #given the name of the list and item, look it up
local($list, $key) = @_;
return (1) if (($main'config_opts{$list,$key} != 0) &&
$main'config_opts{$list,$key} ne '');
return (0);
}
------
In &cf_ck_bool(), $list takes on the value of $clean_list from the above
function call. But, $key doesn't appear to be taking on any value at all.
Furthermore, why give the function call a third parameter, 1?
It seems that every function call like this would return 0, since I
can't find the a statement that initializes config_opts{"somelistname,"}.
Why not, instead of using this function call, just hardwire a '0'
into the code where needed??
I'm sure there is a good answer to this, but I need some clues to find it.
Thanks,
Bob
Follow-Ups:
|
|