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


ALPM documentation  | view source Contained in the ALPM distribution.

Index


NAME

Top

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

SYNOPSIS

Top

  # 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' );

DESCRIPTION

Top

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.

CONSTRUCTOR

Top

new

 $OBJ = ALPM::LoadConfig->new( custom_fields => \%FIELDS_REF? );

Parameters

\%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.

METHODS

Top

load_config

 undef = $OBJ->load_config( $CFG_FILE_PATH )

This method will read a configuration file, setting ALPM options as it goes.

Parameters

$CFG_FILE_PATH

The path to the configuration file to read.

SEE ALSO

Top

ALPM

AUTHOR

Top

Justin Davis, <juster at cpan dot org>

COPYRIGHT AND LICENSE

Top


ALPM documentation  | view source Contained in the ALPM distribution.