gnu@perl has asked for the wisdom of the Perl Monks concerning the following question:
Will each instance of $mailer in the children actually be the same object affecting the same data or will they be their own seperate entity containing only the data populated in $mailer up to the point of forking? In other words, if in one child I change/add something via a $mailer method, will it affect the other processes? It dosen't seem like it could, but I'm not sure. -Chaduse My_Mailer; my $mailer = My_Mailer->new(); for (my $x=0;$x < 10;$x++) { unless (fork) { $mailer->initialisation_stuff(); $mailer->send(); exit; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Objects and forking
by tilly (Archbishop) on Jul 10, 2003 at 17:56 UTC | |
by gnu@perl (Pilgrim) on Jul 10, 2003 at 18:00 UTC | |
|
Re: Objects and forking
by Jenda (Abbot) on Jul 10, 2003 at 20:54 UTC | |
by gnu@perl (Pilgrim) on Jul 11, 2003 at 13:35 UTC | |
|
Re: Objects and forking
by sauoq (Abbot) on Jul 10, 2003 at 21:01 UTC | |
by gnu@perl (Pilgrim) on Jul 11, 2003 at 13:40 UTC |