in reply to Objects and forking

It depends on what happens in your new() method. If you open up a connection to the outside world, then the mail server will be likely to be confused as multiple children babble. If the connection is opened in your initialisation_stuff(), then each object will start off as separate clones.

BTW your looping style is very C-ish. You will avoid most fencepost and off-by-one errors (both extremely common bugs) if you switch to the more Perlish:

foreach my $x (0..9) { ... }

Replies are listed 'Best First'.
Re: Re: Objects and forking
by gnu@perl (Pilgrim) on Jul 10, 2003 at 18:00 UTC
    Thanks, this is the way I thought it would work. The handle to sendmail is opened in each child when the send() method is called on the object.
    As for the looping, that is not what the code does (but thanks for the input just in case), it was just an little example. In actuality I load an array with the location of a bunch of config files and then fork to process each config file.