Perhaps not the issue, but
++$active_readers should be later in the parent, after checking if the fork was successful.
Why the exec in line 47? You could just as easily print from perl.
What system are you running on? I'm guessing there's a fork limit or something involved, and the perl script isn't getting any CPU or IO cycles, and is hanging there. Have you checked the CPU usage? Have you considered tracing the execution, and finding the last line executed before the hang?
-QM
--
Quantum Mechanics: The dreams stuff is made of