"raphael()" <raphael.j...@gmail.com> wrote on 05/10/2010 04:07:58 PM:
> I want to do work on all elements of an array simultaneously.

To clarify: You want to access an hash defined in the parent process from
all N child processes?

I'm sorry to tell you, but this won't work so easily. When forking, data is
*copied*. Which means that every child process gets a copy of all the
parent's variables, but whenever you modify them, the modification has only
an effect within the child process, because it's just a copy.

There's a whole bag full of inter process communication (IPC) algorithms,
ranging from files over sockets to posix message queues. You might to have
a look at "perldoc perlipc" and the whole lot of IPC modules on cpan.

HTH.

                  Eric

--
Eric MSP Veith <eric.ve...@de.ibm.com>
Hechtsheimer Str. 2
DE-55131 Mainz
Germany

IBM Deutschland GmbH
Vorsitzender des Aufsichtsrats: Erich Clementi
Geschäftsführung: Martin Jetter (Vorsitzender), Reinhard Reschke, Christoph
Grandpierre, Matthias Hartmann, Michael Diemer, Martina Koederitz
Sitz der Gesellschaft: Stuttgart
Registergericht: Amtsgericht Stuttgart, HRB 14562
WEEE-Reg.-Nr. DE 99369940


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to