use threads; use threads::shared; my(%state):shared;