I have a package:
package MAIN::Config;
it has the following functions in it :
sub new {
-- *** This function returns the o/p as follows :
GLOBAL REQ_SUBID = 0000000000000001
DATABASE DBUSER = sit
PATH CONFIG_DATA_PATH = ./data/
...etc
}
sub getValue(\%) {
my $this = shift;
my %fields = @_;
return $this->{VALUES}{GLOBAL}{$fields{KEY}} unless $this->{VALUES}{$fields{COMPONENT}}{$fields{KEY}};
}
----------------------------------------------
Please can you help me by telling me what the getValue function present in the MAIN::Config package does. When it is called in Line 3 in the main perl script :
Line 1) my $cfg = MAIN::Config->new(); # the o/p of the new() is as mentioned above.***
Line 2) $req_subscriber_id = $cfg->getValue(COMPONENT=>"",KEY=>"REQ_SUBID") || 000000000000001;
Line 3) $dbuser = $cfg->getValue(COMPONENT=>"DATABASE", KEY=>"DBUSER");
......
package MAIN::Config;
it has the following functions in it :
sub new {
-- *** This function returns the o/p as follows :
GLOBAL REQ_SUBID = 0000000000000001
DATABASE DBUSER = sit
PATH CONFIG_DATA_PATH = ./data/
...etc
}
sub getValue(\%) {
my $this = shift;
my %fields = @_;
return $this->{VALUES}{GLOBAL}{$fields{KEY}} unless $this->{VALUES}{$fields{COMPONENT}}{$fields{KEY}};
}
----------------------------------------------
Please can you help me by telling me what the getValue function present in the MAIN::Config package does. When it is called in Line 3 in the main perl script :
Line 1) my $cfg = MAIN::Config->new(); # the o/p of the new() is as mentioned above.***
Line 2) $req_subscriber_id = $cfg->getValue(COMPONENT=>"",KEY=>"REQ_SUBID") || 000000000000001;
Line 3) $dbuser = $cfg->getValue(COMPONENT=>"DATABASE", KEY=>"DBUSER");
......