I am in Windows running a Perl script that calls an executable:

```
 $command = "$path_to_exe -i $dir -o $results";
 my $pid = fork();

    if ( !$pid ) {
        system($command);

        #do stuff

    } else {
        #do stuff
    }

 print "Exiting..."
 exit;

```

Instead of exiting after, perl.exe just idles. A pop-up then tells me that the "Perl command line interpreter has stopped working."

I don't know very much about process management in Windows, and I have read previously on this forum that it's not good practice to use `fork()` and `exec()`, but the code works well besides the interpreter not closing part. I've tried everything from trying to implement the program in Unix (which gives the same error) to using `Win32::Process` commands -- but nothing works. I hoped there might be a simpler solution that would allow me to preserve what I've already written. 

If anyone could explain what exactly is happening in Windows when this code is run, that would be a help too!