dcasey has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl -w use strict; use Config::Simple; my $config_file = shift; if (!$config_file) { $config_file = "etc/allweb-backup.conf"; } unless (my $cfg = new Config::Simple($config_file)) { print "CRITICAL: $config_file is not a valid INI file!\n"; } my %Config = $cfg->vars(); print "###############################################\n-CONFIG-: $con +fig_file\n"; while (my($key,$val) = each %Config) { if (!$val) { print "WARNING : $key has NULL value!\n"; my $count++; }else { print "OK : $key has value of $val\n"; } } print "#########################################\ndone.\n";
|
|---|