#cat child.pl use strict; use warnings; print "I'm the child with PID $$\n"; sleep 3; print "Exit now.." and exit 0; #END{ system qq(tasklist /v /fo LIST /fi "PID eq $$") } END{ system qq(wmic PROCESS where "processid=$$" get * /FORMAT:LIST) } # call it from a oneliner perl -e "system ($^X, qq(child.pl))" I'm the child with PID 298184 Exit now.. Caption=perl.exe CommandLine=C:\Perl\bin\perl.exe child.pl [...] ProcessId=298184 [...]