Skip Menu |

This queue is for tickets about the Config-Simple-Extended CPAN distribution.

Report information
The Basics
Id: 77491
Status: new
Priority: 0/
Queue: Config-Simple-Extended

People
Owner: hesco [...] campaignfoundations.com
Requestors: hesco [...] campaignfoundations.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.06
  • 0.07
  • 0.08
  • 0.09
Fixed in: (no value)



Subject: Config::Simple::Extended needs a ->watch() constructor
perldoc Log::Log4perl # Check config every 10 secs Log::Log4perl::init_and_watch('/etc/log4perl.conf',10); We need a similar feature for a Config::Simple object UNTESTED package My::New::Module; sub new { my $class = shift; my $defaults = shift; my $watch_interval = shift || undef; my $self = {}; if(defined($defaults->{'config_file'})){ $self->{'cfg'} = Config::Simple::Extended->watch( $defaults->{'config_file'}, $watch_interval ); } elsif(defined($defaults->{'config_files'})){ my $cfg; undef($cfg); foreach my $file (@{$defaults->{'config_files'}}){ $cfg = Config::Simple::Extended->inherit({ base_config => $cfg, filename => $file }, $watch_interval ); } $self->{'cfg'} = $cfg; } else { die "Constructor invoked with no Confirguration File." } my $db = $self->{'cfg'}->get_block('db'); # print STDERR Dumper(\$db); $self->{'dbh'} = My::New::Module::DB->connect($db); bless $self, $class; return $self; } Have ->inherit(), use ->watch(), and ->watch() use Config::Simple->new().