$x = 111; $y = "This is a string"; print '$x is in string format' if ($x & ~$x); print '$y is in string format' if ($y & ~$y);