in reply to Debugging without shell access?

One minor point, not related to your problem, that caught my eye: I think EOF is not the best choice for a heredoc terminator. I would recommend something like END_HTML. Also, using quotes around the terminator may help the reader, even if the default behavior without the quotes is what you need. Cheers.
print <<"END_HTML"; <html> <head> <title>Masking Private Data</title> </head> <body> <h2>Masking Private Data</h2> This script is masking private data in the test data set with a departure date before $preserve_date. Records related to later events are being preserved.<p> </body> </html> END_HTML