A_Banknote has asked for the wisdom of the Perl Monks concerning the following question:

It's gonna make me carzy to trouble with the defferent sessions' data share.
Is there a easy way to do this? Needn't UNIX sock, needn't any pipes, even needn't to open a file. My only desire is to share a variable between 2 sessions, why is so hard to share do so?
Any solution but thread(which is much sick than fork)?
Thx a ton

Replies are listed 'Best First'.
Re: Can forks share data easilier?
by borisz (Canon) on Sep 18, 2004 at 11:40 UTC
    No, you must access/lock the data from the other process. This can be done with sockets, pipes, files, databases and more. There are several modules that help, look here: IPC modules.
    Boris
Re: Can forks share data easilier?
by Zaxo (Archbishop) on Sep 18, 2004 at 17:58 UTC

    SysV IPC's shared memory will do what you want, but you need to run on a kernel that supports it. I haven't used that much, disliking SysV IPC in general, but IPC::ShareLite's readme looks promising.

    After Compline,
    Zaxo