diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-10-17 16:30:40 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-10-17 16:30:40 +0000 |
commit | 92b6bb5f81aedd038238256d9d1404ca583e6d7a (patch) | |
tree | 396b28f30007b653e48873509f656bf2a784e25e /common | |
parent | 826190fb4bcf8dd37ff99bcda075bcd086cc8847 (diff) | |
download | drakwizard-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.pm | 9 |
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) { |