
ALPM::LoadConfig - pacman.conf config file parsing class.

# At startup:
use ALPM qw( /etc/pacman.conf );
# At runtime:
ALPM->load_config('/etc/pacman.conf');
# Load custom fields as well:
my $value;
my %fields = ( 'CustomField' => sub { $value = shift } );
my $loader = ALPM::LoadConfig->new( custom_fields => \%fields );
$loader->load_file( '/etc/pacman.conf' );

This class is used internally by ALPM to parse pacman.conf config files. The settings are used to set ALPM options. You probably don't need to use this module directly.

$OBJ = ALPM::LoadConfig->new( custom_fields => \%FIELDS_REF? );
\%FIELDS_REF (Hash Reference) (Optional)Keys are field names from the /etc/pacman.conf configuration file. Values are code references. When a field is found inside the configuration file with the exact same name, then the code reference is called, passed the value of the entry as the only argument.

undef = $OBJ->load_config( $CFG_FILE_PATH )
This method will read a configuration file, setting ALPM options as it goes.
$CFG_FILE_PATHThe path to the configuration file to read.


Justin Davis, <juster at cpan dot org>

Copyright (C) 2011 by Justin Davis
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.