I saw recently in on an answer here on Stackoverflow where a calculation was done to determine whether a value was odd or even. There was a
$result = $str % 2;
It's the "modulo" operator, see perlop.
[...] computes the division remainder of its first argument with respect to its second argument.