package ConfigObjects; use strict; use warnings; use Exporter 'import'; use parent 'Config::General'; our $VERSION='0.1'; our @EXPORT_OK=qw(CFG_check_cfg); # Main config checker sub CFG_check_cfg { my $self=shift; my $return=1; # True by default (all good) $return&=CFG_check1($self); $return&=CFG_check2($self); return $return; } # Unit checks: sub CFG_check1 { my $self=shift; return (#Some property of the $self->{config} data structure); } 1; __END__ #### my $cfg_obj=ConfigObjects->new(-ConfigFile => $opt_config_file); pod2usage(-verbose => 1, -exitval => 1, -msg => "ERROR: Config file has errors") unless ($cfg_obj->CFG_check_cfg);