From a9b571022bcd13399eb5aa10d1b390f952daeaa2 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 17 Oct 2012 16:30:37 +0000 Subject: perl_checker cleanups --- common/Varspaceval.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'common') 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 () { + 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 () { + 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}; -- cgit v1.2.1