summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-10-17 16:30:37 +0000
committerThierry Vignaud <tv@mageia.org>2012-10-17 16:30:37 +0000
commita9b571022bcd13399eb5aa10d1b390f952daeaa2 (patch)
treef2716faeda2a4a9c068b24c962ae1d7826c69aa5 /common
parente1e9c6f53485d145e0b995687a877e2abf9e916a (diff)
downloaddrakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.tar
drakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.tar.gz
drakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.tar.bz2
drakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.tar.xz
drakwizard-a9b571022bcd13399eb5aa10d1b390f952daeaa2.zip
perl_checker cleanups
Diffstat (limited to 'common')
-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};