Help for this page
As I already said, you could tie the variable with a self-made STORE ( +This, Value) function which does your checks on Value before storing +it.
You could use Tie::Scalar to make sure that a var $x will always stay +an integer, by declaring STORE. But that will slow down every operati +on on $x.