in reply to zero vs. empty
If you have warnings turned on, then an 'unitialized value use' error will be generated. Don't be tempted to 'default' the param with the empty string:use strict; use CGI qw(:standard); my $foo = param('foo'); if ($foo) { print "true value\n"; } elsif ($foo eq 0) { print "zero value\n"; } else { print "undef value\n"; }
This will prevent the warning, but if the user sends a zero, $foo will instead contain the empty string.my $foo = param('foo') || '';
Second question, I really don't know. I can tell you that trying to understand how to use a module is best done by reading the documentation and studying any example files that are bundled in the tar ball, and not necessarily by actually trying to read the code itself. ConfigReader::Simple does have an example.pl script file and an example.config config file. It might be possible that this module cannot handle arrays like you wish. You should check out the more powerful Config::General.
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |