Well I've got my own answer, I don't know if you've figured this out yet but I might as well post the solution for anyone else running into this.
You have to run the Perl program from Qshell! You can start an interactive session in Qshell with the QSH command, or run the program with this type...