in reply to Can't find string terminator "ENDHEADER" anywhere before EOF

First, try removing the tab/whitespace before your terminator (i.e. ENDHEADER). Second, your return is in the wrong block. should look more like this:
#!/usr/bin/perl sub print_chat { print <<ENDHEADER; Content-type: text/html <html> <head><title>My Chat</title> </head> </html> ENDHEADER return 1; }

20040920 Janitored by Corion: Added code tags