in reply to Idomatic Handling of Subroutine Error
Not recommended for production code (for one thing maintanence would be a beast) but fun to play with...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";
-Blake
|
|---|