NAME
Util::FileMod - A flexible interface for modifying simple flat text config files.
SYNOPSIS
# for space seperated, unquoted key/value files, like modules.conf
my $rc = new Util::FileMod(Seperator => ' ', Quotes => '', Comment => '#');
$rc->add_vars(
"alias eth0" => "eepro100",
"alias eth1" => "pcnet32",
"alias tr0" => "olympic",
);
$rc->update_file("/mnt/etc/modules.conf");
# for '=' seperated, double quoted key/value files, like the suse rc.config file # and most rc files
my $rc = new Util::FileMod(Seperator => '=', Quotes => '"', Comment => '#');
$rc->add_vars(
IPADDR_0 => "192.168.64.101",
NETDEV_0 => "eth0",
IFCONFIG_0 => "192.168.64.101 broadcast 192.168.64.255 netmask 255.255.255.0",
NETCONFIG => "_0",
);
$rc->update_file("/mnt/etc/rc.config");
# Note: Defaults to Seperator => '=', Quotes => '"', Comment => '#'