in reply to Close Win32-Console CMD.exe

There is no need to open or close a command window to run a Perl program on Win 10.

Please show your code.

Oh, I see..
You open an O/S window shell by say using 'cmd' and then type in a command that runs a Perl script.
The Perl program can exit(), you come back to the window that you started in the first place.
Perl can not cause its parent to exit.

#if your Win 10 Perl is configured correctly, #save the following lines as "test.pl". print STDERR "asdasdf\n"; sleep (3); print STDERR "Goodbye\n"; sleep (2);
Double-click on test.pl in the GUI and you will see the result.