If an error occurs during a function call, using GetError() might return an incorrect value if running in a multithreaded environment such as using the PerlIS.dll ISAPI application or using PerlScript. The reason for this is that the last error is held in a single variable. If an error occurs, the error number is stored in the variable. It is possible that between the time you call a function and the time you call GetError(), another script could have been run (a CGI script on a web server, for example) that would change the value of the LastError variable. The Win32::NetAdmin extension is not thread friendly. For more information about this, refer to the “Threads” section earlier in this chapter.