summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-10-17 16:30:40 +0000
committerThierry Vignaud <tv@mageia.org>2012-10-17 16:30:40 +0000
commit92b6bb5f81aedd038238256d9d1404ca583e6d7a (patch)
tree396b28f30007b653e48873509f656bf2a784e25e /common
parent826190fb4bcf8dd37ff99bcda075bcd086cc8847 (diff)
downloaddrakwizard-92b6bb5f81aedd038238256d9d1404ca583e6d7a.tar
drakwizard-92b6bb5f81aedd038238256d9d1404ca583e6d7a.tar.gz
drakwizard-92b6bb5f81aedd038238256d9d1404ca583e6d7a.tar.bz2
drakwizard-92b6bb5f81aedd038238256d9d1404ca583e6d7a.tar.xz
drakwizard-92b6bb5f81aedd038238256d9d1404ca583e6d7a.zip
(get,commit) do not reinvent cat_()
Diffstat (limited to 'common')
-rw-r--r--common/Varspaceval.pm9
1 files changed, 3 insertions, 6 deletions
diff --git a/common/Varspaceval.pm b/common/Varspaceval.pm
index 0da4393c..feef189d 100644
--- a/common/Varspaceval.pm
+++ b/common/Varspaceval.pm
@@ -19,10 +19,8 @@ use MDK::Common;
sub get {
my ($_self, $file) = @_;
my %l;
- open my $F, $file or return;
- local $_;
- while (<$F>) {
+ foreach (cat_($file)) {
my ($v, $val, $val2) =
/^\s* # leading space
@@ -46,10 +44,9 @@ sub commit {
my ($_self, $file, $hash) = @_;
my $output = "";
- if (open(my $F, $file)) {
- local $_;
+ if (-r $file) {
- while (<$F>) {
+ foreach (cat_($file)) {
my ($pre, $key, $eq, $val, $rest) = /(^\s*)(\w+)(\s*"*'*)([^'"\s]*)(.*)/x;
if (!defined $key) {