Libconf - Set of abstraction layers to the linux/unix configuration
use Libconf::Glueconf::Networking::Resolv; my $resolv = new Libconf::Glueconf::Networking::Resolv('/etc/resolv.conf'); push(@{$resolv->{nameserver}}, '192.168.76.7'); $resolv->{search}->[1] = 'foo'; $resolv->writeConf('/etc/resolv_modified');
$struct = new Libconf("smb.conf", 'samba', ''); $struct->editAtom(-1, {key => 'writable', value => 'TEST', sections => [{name => 'homes'}] }); $struct->appendAtom({key => 'K1', value => 'hello', type => 'KEY_VALUE' }); $struct->writeConf("smb.conf");
See the Libconf::Templates manpage for more information on this layer
the Libconf::System manpage, the Libconf::Glueconf manpage, the Libconf::Templates manpage