in reply to Command Line Output Different from Output to Browser
Try putting:
print "Content-type: text/html\n\n"; [download]
use CGI qw(standard); print header(); [download]
stephen