in reply to Testing for empty string
So? That's what parens are for:won't work because the !~ binds tighter than the "="...if ($rc=$ref->getc!~/./) { ... }
I like parens -- they're Good Things. But the first reply was right: since you're using getc, you should just test for the return value being defined:if (( $rc = $ref->getc ) !~ /./ ) { ... }
if ( defined( $rc = $ref->getc )) { ... }
|
|---|