Config::Model::Backend::Debian::DpkgSyntax - Role to read and write files with Dpkg syntax
version 1.213
# in Dpkg dedicated backend class
This module is a Moose role to add capacity to read and write dpkg control files to Config::Model backend classes.
Read a control file from the file_handle and returns a nested list (or a list ref) containing data from the file.
The returned list is of the form :
[ # section 1 [ keyword1 => value1, # for text or simple values keyword2 => value2, # etc ], # section 2 [ ... ] # etc ... ]
Munge the passed list ref into a string compatible with control files and write it in the passed file handle.
The input is a list of list in a form similar to the one generated by parse_dpkg_file:
[ section [ keyword => value | value_list ] ]
Except that the value may be a SCALAR or a list ref. In case, of a list ref, the list items will be joined with the value list_sep before being written.
list_sep
For instance the following code :
my $ref = [ [ Foo => 'foo value' , Bar => [ qw/v1 v2/ ] ]; write_dpkg_file ( $ioh, $ref, ', ' )
will yield:
Foo: foo value Bar: v1, v2
Dominique Dumont, (ddumont at cpan dot org)
Config::Model, Config::Model::AutoRead, Config::Model::Backend::Any,
To install Config::Model, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Model
CPAN shell
perl -MCPAN -e shell install Config::Model
For more information on module installation, please visit the detailed CPAN module installation guide.