From 9ebbcfd470073c5aa97aace9b94d392d21354846 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 4 Feb 2009 11:07:29 -0800 Subject: Vyatta::Config - parseTmpl convert to 3 arg open --- lib/Vyatta/Config.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm index a66d6c8..f929e6a 100755 --- a/lib/Vyatta/Config.pm +++ b/lib/Vyatta/Config.pm @@ -259,7 +259,7 @@ sub returnOrigValues { my $val = returnOrigValue(@_); my @values = (); if (defined($val)) { - @values = split("\n", $val); + @values = split("\n", $val); } return @values; } @@ -495,8 +495,10 @@ sub parseTmpl { if (! -r "$tpath/node.def") { return ($is_multi, $is_text); } - open(TMPL, "<$tpath/node.def") or return ($is_multi, $is_text); - foreach () { + + open (my $tmpl, '<', "$tpath/node.def") + or return ($is_multi, $is_text); + foreach (<$tmpl>) { if (/^multi:/) { $is_multi = 1; } @@ -507,7 +509,7 @@ sub parseTmpl { $default = $1; } } - close TMPL; + close $tmpl; return ($is_multi, $is_text, $default); } -- cgit v1.2.3