summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/Varspaceval.pm13
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};