And don’t you just hate the superfluous trailing ; before a } ?
if ( $n>10) {
$n=1;
++$x; // what's the stupid semicolon on this line good for?
}