if (defined $string and $string ne "") { ..... }