$thispid = @ARGV[0]; $threadpriority = @ARGV[1]; use Win32::API; $retcode = Win32::API->Import( 'Kernel32', q[ BOOL SetThreadPriority( HANDLE hThread, int nPriority ) ] ); print "import set threadpriority = $retcode \n"; $retcode = SetThreadPriority( $thispid, $threadpriority ); print "set threadpriority = $retcode \n";