Your cp.cgi file seems to be working fine, just set up your paths and you should be ready to go.