if ( is_tainted($variable) ) { die "tainted"; } else { die "not tainted"; } sub is_tainted { return ! eval { join('',@_), kill 0; 1; }; }