summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-02-04 11:07:29 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-02-04 11:07:29 -0800
commit9ebbcfd470073c5aa97aace9b94d392d21354846 (patch)
tree371377187f31c326fae1a5bbd4a316c0529825ce /lib
parent4311b83716b52b47969e4523128c77131c4da87e (diff)
downloadvyatta-cfg-9ebbcfd470073c5aa97aace9b94d392d21354846.tar.gz
vyatta-cfg-9ebbcfd470073c5aa97aace9b94d392d21354846.zip
Vyatta::Config - parseTmpl convert to 3 arg open
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Config.pm10
1 files changed, 6 insertions, 4 deletions
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 (<TMPL>) {
+
+ 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);
}