you get an Odd number of elements in hash assignment warning.
Even if you fix/ignore that, how do you know the sub didn't mean to return a (non-error) ( "" => undef ) list?
If one chooses to use a return value of undef to signify errors, it makes sense to return references for non-error conditions — even for scalars.
Personally, I try to let any false value indicate failure. This would include undef/''/0
for scalar returns, and empty lists for arrays/hashes.
This hash the "advantage" of being consistent with many of the built-in functions.
But when I need more power (which is usually), I throw exceptions for errors and make the assumption
that a function call returning means success.
my @a = foo();
# if I'm here, then foo() succeeded. at least, it didn't throw an