From 1fe8bed07a33c6df91959520130c1867afce28df Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 4 Dec 2009 17:51:01 -0800 Subject: 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) --- lib/Vyatta/Config.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib/Vyatta') 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 () { + 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 () { + 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 () { + 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; -- cgit v1.2.3