Config-FileManager

 view release on metacpan or  search on metacpan

lib/Config/FileManager.pm  view on Meta::CPAN


This method check if the current config file is up-to-date and proposes an update if it is not.
The update tries to preserve custom user's settings.

Usage:

  $cfg->update();

=cut

sub update($) {
  my $self = shift;

  # Check if config file is up-to-date
  open (CFG_FILE, "<".$self->getPath) or croak "Unable to open config file [".$self->getPath."]: $!";
  my @versions = $self->versions;
  my $current_user_config_version = $versions[-1];
  my $current_user_config = "";
  while (<CFG_FILE>) {
    $current_user_config .= $_;
    if (/^#.*configuration file (\d+.\d+.\d+.*)$/) {

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.482 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )