Did you actually put that in a batch file (read your M$ manual) and then call the batch file from Perl, or did you merely try to insert it in the code you've shown?
If you didn't program your executable by toggling in binary, it wasn't really programming!