in reply to Re: Shared variables between threads
in thread Shared variables between threads

Well, The posted version is a simpler than the original, i do things at the main thread. In fact that is the key, because i need to finalize the capture thread just after finishing those things (changed by the "sleep 3" in the example).
If i understand correctly the thread system in perl all not explicitly shared variables are copied in the child thread.
So, if i open_live before splitting my child will obtain a copy of that descriptor. I don't know how can that affect to my script (closing or using a copied descriptor).
I've tried it and breakloop should force the loop exit but instead it does nothing because breakloop returns correctly but loop inside the child thread never returns.