in reply to OT:A javascript problem.

Either you will need to have some good mutex construction, or else you will need to play games with setting a timeout. Should you set timeouts note that you have to pass it a string to eval as a function, not actual functions. (Gosh darn.)

If you come up with a good mutex construction to synchronize events, please tell me. I have one that seems to work, but kills the CPU and has a race in it. (Which is, however, very unlikely to be tripped.) I would like a better one.

Good luck in your JavaScript exile. But two random notes. First of all JavaScript supports anonymous functions, closures, and all that, so that transfers to and from Perl. The second is the fact that JavaScript objects are basically references to hashes. That little translation may allow you to figure out how to apply a few Perlish tricks to your benefit.