in reply to is sharing variables between forked process possible??

To share data between different processes you can use a module like IPC::Shareable.

But if all you need is to set a timer on the child, just use alarm $timeout on the child after forking, and after the code that can hang alarm 0.

If the timeout expires, as you have not defined any handler for ALRM signal, the child will die, and you will be able to see that on the parent looking at $? (see perlvar doc).