Is there a limit to the number of children in Perl?
"Ahmed Moustafa" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Tagore Smith wrote: > > > Ahmed Moustafa wrote: > > > > > >>So, how can a new different process by forked? Or, how a function be > >>called and the next step execute without waiting for the previous > >>function to terminate? > >> > > > > For your original question (threads) see perldoc perlthrtut. > > > > When you fork a child process the call to fork returns the child pid to > > the parent and 0 to the child. So you can write code that tests the return > > value and does one thing in the parent process (continue forking children to > > deal with the rest of your files) and another in the child process (process > > the current file). You can also use exec to execute another process which is > > not a "clone" of the parent. > > > > See perldoc -f fork and perldoc -f exec. > > > > Out of curiosity, why do you want to do this? > > > The main loop looks for files which are sent via FTP. Once a file is on > the server, it should be encrypted. The encryption process is slow so > some files stay as plain text waiting for their turns to be found and > encrypted. > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]