in reply to WScript

Wscript is a Microsoft Windows scripting engine object - the examples you are attempting to re-implement in perl probably use VBScript.

You should "use strict;" in your perl code - this would have told you the $WScript is undefined, and in this case, unnecessary.

The function the original code appears to be trying to do is implemented in perl via the "exit" built-in function.

Update:s/sctrict/strict/ (Thanks FunkyMonk)

     ..to maintain is to slowly feel your soul, sanity and sentience ebb away as you become one with the Evil.