From 6848fbee522dee4d01f49b9354ad0b728ebce516 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 28 Mar 2010 08:32:11 -0700 Subject: 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. --- lib/Vyatta/Config.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') 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; -- cgit v1.2.3