in reply to Comparing undefined values

Smart match might be of interest. Looks like '' ~~ $x does exactly what you want. Dunno about $x ~~ ''.

Update: $x ~~ '' works as well, according to the patch's author. They don't even warn.