You have several options. Themes , sockets , IPC and write to a file with file locking. Personally, I would recommend themes, they are very easy and safe in Perl, most installations are compiled, and they are quite effective after creating the stream.
An interesting alternative is the forks module, which emulates threads using a combination of fork () and sockets. I never used it myself, but Elizabeth Mattisen knows her own topics.
source share