use strict; use Win32::Process; my $SysDir = "$ENV{SystemRoot}\\system32"; my @cmds = ( [ "$SysDir\\netstat.exe", 'netstat -na' ], [ $^X, 'perl -le "print\"pid=$$:Sleep 5 secs.\";sleep 5"' ], ); for my $cmd (@cmds) { Win32::Process::Create(my $hProc, # process object $cmd->[0], # executable $cmd->[1], # command line 1, # inherit handles NORMAL_PRIORITY_CLASS, # priority '.') # working dir or die "error create process: $^E\n"; my $pid = $hProc->GetProcessID(); print "Process pid $pid launched.\n"; } print "I'm outta here.\n";