...length test will catch it if the value of $x = 0, hmmm, if $x == 0, then length() test will not be executed - aka, it suffers from the same problem (with my attempt) that ikegami kindly pointed out.
A user level that continues to overstate my experience :-))