diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-03-28 08:32:11 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-03-28 08:32:11 -0700 |
commit | 6848fbee522dee4d01f49b9354ad0b728ebce516 (patch) | |
tree | 7889726c7f5db97ca66f4129d938dfa231559be2 | |
parent | 5badee4290bd825484d563858f363893424b3f92 (diff) | |
download | vyatta-cfg-6848fbee522dee4d01f49b9354ad0b728ebce516.tar.gz vyatta-cfg-6848fbee522dee4d01f49b9354ad0b728ebce516.zip |
Fix perlcritic warnings
Don't explicitly return undef.
Also no need to test for file existance, then open it.
Just do open, and if that fails file does not exist.
-rwxr-xr-x | lib/Vyatta/Config.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm index df4d20f..58dd7ea 100755 --- a/lib/Vyatta/Config.pm +++ b/lib/Vyatta/Config.pm @@ -738,8 +738,9 @@ sub parseTmplAll { my %ret = (); my $tpath = $self->getTmplPath(\@pdirs); return unless $tpath; - return undef if (! -r "$tpath/node.def"); - open(my $tmpl, '<', "$tpath/node.def") or return undef; + + open(my $tmpl, '<', "$tpath/node.def") + or return; foreach (<$tmpl>) { if (/^multi:/) { $ret{multi} = 1; |