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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.