Just for fun, take a look at
"Falsify" scalar strings. Its a quick hack that overloads certain strings so that they act FALSE in boolean context. For instance, you could have the odd looking construct:
unless ($error_or_result = my_sub()) { # FALSE in boolean context
# but still contains text when stringified
die "Your error was: $error_or_result\n";
}
print "Your result was $error_or_result\n";
Not recommended for production code (for one thing maintanence would be a beast) but fun to play with...
-Blake