YAML::AppConfig

YAML::AppConfig can manage configuration files with YAML and variable reference.
Download

YAML::AppConfig Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Matthew O'Connor
  • Publisher web site:
  • http://search.cpan.org/~cdent/PurpleWiki-0.94/PurpleWiki/View/Driver.pm

YAML::AppConfig Tags


YAML::AppConfig Description

YAML::AppConfig can manage configuration files with YAML and variable reference. SYNOPSIS use YAML::AppConfig; # An extended example. YAML can also be loaded from a file. my $string = $string); # Get settings in two different ways, both equivalent: $conf->get("etc_dir"); # returns /opt/etc $conf->get_etc_dir; # returns /opt/etc # Get raw settings (with no interpolation) in three equivalent ways: $conf->get("etc_dir", 1); # returns '$root_dir/etc' $conf->get_etc_dir(1); # returns '$root_dir/etc' $conf->config->{etc_dir}; # returns '$root_dir/etc' # Set etc_dir in three different ways, all equivalent. $conf->set("etc_dir", "/usr/local/etc"); $conf->set_etc_dir("/usr/local/etc"); $conf->config->{etc_dir} = "/usr/local/etc"; # Changing a setting can affect other settings: $config->get_var2_dir; # returns /opt/var2 $config->set_var_dir('/var/'); # change var_dr, which var2_dir uses. $config->get_var2_dir; # returns /var2 # Variables are dynamically scoped: $config->get_libs->{perl}->{vendor}; # returns "/opt/usr/lib/perl" # As seen above, variables are live and not static: $config->usr_dir('cows are good: $root_dir'); $config->get_usr_dir(); # returns "cows are good: /opt" $config->resolve('rm -fR $root_dir'); # returns "rm -fR /opt" # Variables can be escaped, to avoid accidental interpolation: $config->get_escape_example(); # returns "/opt/$var_dir/$var_dir" # Merge in other configurations: my $yaml = $yaml); $config->get_root_dir(); # returns "cows" $config->get_foo(); # returns "are good" # Get the raw YAML for your current configuration: $config->dump(); # returns YAML as string $config->dump("./conf.yaml"); # Writes YAML to ./conf.yaml Requirements: · Perl


YAML::AppConfig Related Software