summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-04 17:51:01 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-04 17:51:01 -0800
commit1fe8bed07a33c6df91959520130c1867afce28df (patch)
tree0c06f2e96f906f0a1069a5262da3100470986420
parent2a15b2916a74273da604830d6080ebc289708015 (diff)
downloadvyatta-cfg-1fe8bed07a33c6df91959520130c1867afce28df.tar.gz
vyatta-cfg-1fe8bed07a33c6df91959520130c1867afce28df.zip
Fix perlcritic warnings in Config.pm
Config.pm: Bareword file handle opened at line 156, column 7. See pages 202,204 of PBP. (Severity: 5) Config.pm: Bareword file handle opened at line 353, column 7. See pages 202,204 of PBP. (Severity: 5) Config.pm: Bareword file handle opened at line 429, column 7. See pages 202,204 of PBP. (Severity: 5)
-rwxr-xr-xlib/Vyatta/Config.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm
index 7b999b2..e64e6e4 100755
--- a/lib/Vyatta/Config.pm
+++ b/lib/Vyatta/Config.pm
@@ -153,8 +153,8 @@ sub listOrigPlusComNodes {
# my $com_file = "/tmp/.changes_$$";
my $com_file = "/tmp/.changes";
if (-e $com_file) {
- open FILE, "<", $com_file;
- foreach my $line (<FILE>) {
+ open my $file, "<", $com_file;
+ foreach my $line (<$file>) {
my @node = split " ", $line; #split on space
#$node[1] is of the form: system/login/blah
#$coll is of the form: blah
@@ -201,6 +201,7 @@ sub listOrigPlusComNodes {
}
}
}
+ close $file;
close $com_file;
}
@@ -350,8 +351,8 @@ sub returnOrigPlusComValue {
#now need to compare this against what I've done
my $com_file = "/tmp/.changes";
if (-e $com_file) {
- open FILE, "<", $com_file;
- foreach my $line (<FILE>) {
+ open my $file, "<", $com_file;
+ foreach my $line (<$file>) {
my @node = split " ", $line; #split on space
if (index($node[1],$dir_path) != -1) {
#found, now figure out if this a set or delete
@@ -365,6 +366,7 @@ sub returnOrigPlusComValue {
last;
}
}
+ close $file;
close $com_file;
}
return $tmp;
@@ -426,8 +428,8 @@ sub returnOrigPlusComValues {
#now need to compare this against what I've done
my $com_file = "/tmp/.changes";
if (-e $com_file) {
- open FILE, "<", $com_file;
- foreach my $line (<FILE>) {
+ open $file, "<", $com_file;
+ foreach my $line (<$file>) {
my @node = split " ", $line; #split on space
if (index($node[1],$dir_path) != -1) {
#found, now figure out if this a set or delete
@@ -456,6 +458,7 @@ sub returnOrigPlusComValues {
}
}
}
+ close $file;
close $com_file;
}
return @values;