No, I wasn't dismissing your voltage concerns, I was just happy to have found the cause of the "2-command-limit" problem. I realize that there are two unrelated issues here: sketch bug + voltage. I ran the sketch without the relay board, and, as you've suggested, I could run the Monitor and the Perl script one after the other without port drop-outs. Which means that the relays use more juice than the Uno can provide. I now power the relays directly from a 5V 750mA wal-wart and all seems fine. Thanks.
BTW, as I was testing voltages, I plugged a 5V, 1.8A wal-wart into the DC jack of the Uno (the relay board was hooked into Uno's VCC and GND), hoping that the Uno will pass on more juice to the board. At this point Win stopped recognizing the Uno altogether, so I promptly unplugged the 1.8A wal-wart. I then realized that the Uno has a rather wimpy voltage regulator which can't cope with an external DC supply that strong. The regulator ends up throttling the current to, say 50-100mA max, while heating up to the point of potential damage. Like I said, I now power the relay board directly and it works, so hopefully I haven't fried Uno's regulator. Thanks again.