$foo if defined $str and length $str;