diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-10-17 16:30:37 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-10-17 16:30:37 +0000 |
commit | a9b571022bcd13399eb5aa10d1b390f952daeaa2 (patch) | |
tree | f2716faeda2a4a9c068b24c962ae1d7826c69aa5 /common/Varspaceval.pm | |
parent | e1e9c6f53485d145e0b995687a877e2abf9e916a (diff) | |
download | drakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.tar drakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.tar.gz drakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.tar.bz2 drakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.tar.xz drakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.zip |
perl_checker cleanups
Diffstat (limited to 'common/Varspaceval.pm')
-rw-r--r-- | common/Varspaceval.pm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/common/Varspaceval.pm b/common/Varspaceval.pm index 9e996368..e934ada2 100644 --- a/common/Varspaceval.pm +++ b/common/Varspaceval.pm @@ -8,7 +8,7 @@ # Module for loding and committing informations in a VAR = value file type package MDK::Wizard::Varspaceval; -use lib('./'); +#use lib('./'); use strict; use Data::Dumper; @@ -18,10 +18,10 @@ use Data::Dumper; sub get { my ($_self, $file) = @_; my %l; - local *F; open F, $file or return; + open my $F, $file or return; local $_; - while (<F>) { + while (<$F>) { my ($v, $val, $val2) = /^\s* # leading space @@ -43,19 +43,18 @@ sub get { # Commits changes in conf files and ifconfig sub commit { my ($_self, $file, $hash) = @_; - local *F; my $output = ""; - if (open(F, $file)) { + if (open(my $F, $file)) { local $_; - while (<F>) { + while (<$F>) { my ($pre, $key, $eq, $val, $rest) = /(^\s*)(\w+)(\s*"*'*)([^'"\s]*)(.*)/x; if (!defined $key) { $output .= $_; next; - }; + } next if !exists $hash->{$key}; #Elt has been removed no warnings; $val = $hash->{$key}; |