CodingFreak
Programmer
I am forking a process that has worked before but for some reason now when I run it putting an exit to exit out of the process after I'm done I'm getting a memory access error from windows for the perl.exe. Here is the code:
my ($pid, @pids) = (undef, ());
foreach $name (keys %tella)
{
if ($pid = fork)
{
push @pids, $pid;
}
elsif (defined $pid and $pid == 0)
{
foreach $cmd (sort(keys %commands))
{
&fetchTellabsData($name, $tella{$name},$commands{$cmd});
}
exit;
}
else
{
die "can't fork: $!\n";
}
}
foreach $pid (@pids)
{
waitpid $pid, 0
}
Am I doing something wrong?
CF
An expert is someone who learns more and more about less and less and eventually knows everything about nothing
my ($pid, @pids) = (undef, ());
foreach $name (keys %tella)
{
if ($pid = fork)
{
push @pids, $pid;
}
elsif (defined $pid and $pid == 0)
{
foreach $cmd (sort(keys %commands))
{
&fetchTellabsData($name, $tella{$name},$commands{$cmd});
}
exit;
}
else
{
die "can't fork: $!\n";
}
}
foreach $pid (@pids)
{
waitpid $pid, 0
}
Am I doing something wrong?
CF
An expert is someone who learns more and more about less and less and eventually knows everything about nothing