>perl -E"$x='a'; for (1..2) { if ($x =~ /a/g) { say 1 } else { say 0 } }" 1 0