if ($neighbor eq undef){} elsif ($vcid eq undef) {} else { # change to: if ( length $neighbor && length $vcid ) {