Suppose you are an administrator, and you sometimes have to log on to your machine as another user to test for security permissions and such. You can log off of your workstation and log on as that user, but this would require you to close all your applications. Assume, for the sake of argument, that your work habits are like mine, and you have 50 or so windows open, all running different, seemingly important processes. This makes logging off a bit undesirable.
You decide to let Win32 Perl help you out of this dilemma, so you use a Perl script that will impersonate the user and run a program as that user. The script in Example 8.9 provides this functionality.