Since I know some VBScript, I have a rough sense of what your program is doing, so I will give you some pointers to places in the Perl documentation that can help you:
Since you are looking at environment variables, check out %ENV in perlvar
for creating subroutines, such as "LogMessage" and "CreateLogFile", look at perlsub
if you really want to use objects such as WScript.Shell and Scripting.FileSystemObject in your Perl code (though you shouldn't), take a look at Win32::OLE