When using the -w I am getting the following set of warnings that prohibit
execution of the code:
Use of uninitialized value at
/oracle/web/docs-intranet/cgi/dispatcher/lib/request_sub.lib line 18,
<CONF> chunk 1.
Use of uninitialized value at
/oracle/web/docs-intranet/cgi/dispatcher/lib/request_sub.lib line 18,
<CONF> chunk 2.
Use of uninitialized value at
/oracle/web/docs-intranet/cgi/dispatcher/lib/request_sub.lib line 18,
<CONF> chunk 3.
Use of uninitialized value at
/oracle/web/docs-intranet/cgi/dispatcher/lib/request_sub.lib line 18,
<CONF> chunk 7.
Use of uninitialized value at
/oracle/web/docs-intranet/cgi/dispatcher/lib/request_sub.lib line 18,
<CONF> chunk 8.
Use of uninitialized value at
/oracle/web/docs-intranet/cgi/dispatcher/lib/request_sub.lib line 18,
<CONF> chunk 38.
The code executes fine without the -w flag. Here is the code about which
the interpreter complains:
sub processConfFile {
my ($configFile, $conf, $varValueSep, $configComment) = @_;
my ($input) = "";
my ($comment) = "";
my ($var) = "";
my ($value) = "";
open (CONF, "$$configFile") || die("Could not open config file
$$configFile.");
while (<CONF>) {
($input, $comment) = split(/$$configComment/);
chomp($input);
($var, $value) = split(/$$varValueSep/, $input); #line 18, the one
the interpreter complains about
if (($var ne "") && ($value ne "")) {
$var =~ s/^\s*(.*)\s*$/$1/;
$value =~ s/^\s*(.*)\s*$/$1/;
$$conf{$var} = $value;
}
}
}
1;
What I do not understand is that the variables in use here, namely
$var,$value,$input, and $varValueSep (reference passed to subroutine) are
all initialized! So what's the interpreter complaining about? And what
the heck is a chunk?
Thanks
Peter Cline
Inet Developer
New York Times Digital