$var_to_check =~ /sometest/ or die "bad variable!";
I prefer to use such things in my code, and then use find and replace to get rid of them (in production code).
In addition, eval 'can be used to run code sections and capture errors and can be used to create exception handling functionality. If you claim that the value is not 0, perhaps you want to throw an exception and handle this case in a special way?
Ape-inago
source share