good chemistry is complicated,
and a little bit messy -LW
I think you've landed in a sand trap. When I run these in Perl 5.8.1 they perform one iteration and stop. The problem is that you're changing the value of $x in the while condition and the left-hand side of the subtraction can return either the new value or the old value. In my case it's returning the new value which causes the loop to terminate early.
Update: These work for me. I've skipped printing the newline to lower the golf score by 6. I wasn't able to skip the initial assignment but that only saves 1 character anyway.