Click to See Complete Forum and Search --> : Help me with PERL !!!
voum
September 19th, 2001, 08:47 AM
Can u guys help me with PERL? My problem is quite simple : I want to create a new process in a PERL program and pass it arguments. It is something like this :
system('/MyDir/MyProg.pl $arg1 $arg2 &');
I don't know what's wrong with this! So if u've got an idea I will be glad if share it with me...
eskimo
September 19th, 2001, 02:10 PM
maybe this might help :
$stat = system($program, $arg1, $arg2);
die "$program died: $?" unless $stat == 0;
cheerio
eSkImO
voum
September 20th, 2001, 08:48 AM
Well I thank you for the tip. But more precisely, what I'm looking for is :
--> creating a child process with arguments
--> that the parent process doesn't wait for the ending of its child
--> when the child is ended he terminates himself
I think it's possible but I can't grab the right command...
jparker[]
September 20th, 2001, 09:26 AM
Not too sure about "Perl", but, concept that you're looking for is called "forking". In C, when you fork() a process the child acts as an indepdent process from the parent, inheriting the parents permissions. Maybe with that you'll be able to search http://www.google.com for a tutorial, or information on how to fork() processes in Perl
smk
September 25th, 2001, 07:05 PM
heres the info at perl monks (http://www.perlmonks.com/index.pl?node=perlfunc:fork).
but beware of zombies!!