in reply to Testing for Truth

Your first one tests for scalar @$foo and is true because @$foo contains 1 element. Your second test is for the value of the first element of the array which is 0, or false.