Use a here-doc to generate the perl script.