Game-level scoring program for Snooker

Typical session:

perl snooker.pl output.htm
Saving HTML to output.htm
Player 1: John
Player 2: Joe
[John = 0], Joe = 0, 0 ahead, 108 remaining
Playing for red. 10 reds remaining
John's shot [1-7 or X]: 1

[John = 1], Joe = 0, 1 ahead, 100 remaining
Playing for colour, 9 reds remaining
John's shot [1-7 or X]: 7

[John = 8], Joe = 0, 8 ahead, 92 remaining
Playing for red. 8 reds remaining
John's shot [1-7 or X]: x

Download the script (7KB text file, Perl script)>

Sample output - this is the HTML file generated by the program, which is constantly updated as the game progresses