I understand its usually a header has been already sent type scenario but I'm starting to lose it. I have no idea how to sniff out where I mucked up in my code. I tried using a print sub routine that prints both to stdout and to a file. I saved the file output as an html it works. So its not an html issue. But I have no idea how to find out where the premature header is being sent.