#!/your/path/to/perl BEGIN { print "Content-type: text/plain\n\n--OUTPUT--\n"; } ... rest of your script ...