Win32::API->Import( 'Kernel32', q[ BOOL Thread32First( HANDLE hSnapshot, THREADENTRY32 lpte)] ); $retcode = GetLastError(); print "import threadfirst error was $retcode \n";