MDK-Common
view release on metacpan or search on metacpan
lib/MDK/Common/System.pm view on Meta::CPAN
my ($in, $out, %toreplace) = @_;
MDK::Common::File::output($out, map { s/@@@(.*?)@@@/$toreplace{$1}/g; $_ } MDK::Common::File::cat_($in));
}
sub template2userfile {
my ($prefix, $in, $out_rel, $force, %toreplace) = @_;
foreach (list_skels($prefix, $out_rel)) {
-d MDK::Common::File::dirname($_) or !-e $_ or $force or next;
template2file($in, $_, %toreplace);
m|/home/(.+?)/| and chown(getpwnam($1), getgrnam($1), $_);
}
}
sub read_gnomekderc {
my ($file, $category) = @_;
my %h;
foreach (MDK::Common::File::cat_($file), "[NOCATEGORY]\n") {
if (/^\s*\[\Q$category\E\]/i ... /^\[/) {
$h{$1} = $2 if /^\s*([^=]*?)=(.*)/;
}
( run in 0.363 second using v1.01-cache-2.11-cpan-5511b514fd6 )