Try the Perloku approach
Try passing $PORT to the script