diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-04 11:07:29 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-04 11:07:29 -0800 |
commit | 9ebbcfd470073c5aa97aace9b94d392d21354846 (patch) | |
tree | 371377187f31c326fae1a5bbd4a316c0529825ce /lib/Vyatta/Config.pm | |
parent | 4311b83716b52b47969e4523128c77131c4da87e (diff) | |
download | vyatta-cfg-9ebbcfd470073c5aa97aace9b94d392d21354846.tar.gz vyatta-cfg-9ebbcfd470073c5aa97aace9b94d392d21354846.zip |
Vyatta::Config - parseTmpl convert to 3 arg open
Diffstat (limited to 'lib/Vyatta/Config.pm')
-rwxr-xr-x | lib/Vyatta/Config.pm | 10 |
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); } |