The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Config::Reload - Load config files, reload when files changed.

VERSION

version 0.1

SYNOPSIS

    my $config = Config::Reload->new(
        wait => 60,     # check at most every minute (default)
        ...             # passed to Config::ZOMG
    );

    my $config_hash = $config->load;

    sleep(60);

    $config_hash = $config->load;   # reloaded

DESCRIPTION

This Perl package loads config files via Config::ZOMG which is based on Config::Any. Configuration is reloaded on file changes (based on file names and last modification time).

This package is highly experimental and not fully covered by unit tests!

METHODS

new( %arguments )

In addition to Config::ZOMG, one can specify a minimum time of delay between checks with argument 'delay'.

wait

Number of seconds to wait between checking. Set to 60 by default.

checked

Timestamp of last time the files were loaded or checked.

md5

MD5 hash value based on files that have been found, their modification times and sizes.

error

An error message, if loading failed.

found

A list of files found. In contrast to Config::ZOMG, calling this method never triggers a load.

load

Get the configuration hash, possibly (re)loading configuration files.

AUTHOR

Jakob Voß

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Jakob Voß.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 157:

Non-ASCII character seen before =encoding in 'Voß'. Assuming UTF-8