| Bryar-Config-YAML documentation | Contained in the Bryar-Config-YAML distribution. |
Bryar::Config::YAML - Bryar configuration stored in YAML
version 0.103
Bryar::Config::YAML->new(...); Bryar::Config::YAML->load(...);
This encapsulates a Bryar configuration. It can be used to load a new configuration from a file, or provide a reasonable set of defaults.
It loads Bryar configuration from a YAML file.
$self->load($file)
Load the configuration file from somewhere and return the arguments as a hash.
Ricardo SIGNES, <rjbs@cpan.org>
Please report any bugs or feature requests to
bug-bryar-config-yaml@rt.cpan.org, or through the web interface at
http://rt.cpan.org. I will be notified, and then you'll automatically be
notified of progress on your bug as I make changes.
Copyright 2004-2006 Ricardo SIGNES, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Bryar-Config-YAML documentation | Contained in the Bryar-Config-YAML distribution. |
use strict; use warnings; package Bryar::Config::YAML; use base qw(Bryar::Config); use YAML::Syck qw(LoadFile);
our $VERSION = '0.103';
sub load { my ($self, $file) = @_; my %args; my $datadir = $self->{datadir}; if (!-r $file) { if (-r "$datadir/$file") { $file = "$datadir/$file"; } else { return; } } %args = %{ (LoadFile($file))[0] }; return %args; }
1;