1) To get the output of a command into a file descriptor use something like
open(TAR, "tar <options> |") or die "couldn't tar";
print while <TAR>;
2) The webservers I've used will let you trick the browser into thinking a file has a different name by treating the script as a directory. For example, if you have a script at "http://here.com/cgi/download.cgi", you could have the browser pop up with "thisfile.tar.gz" by showing the user the URL "http://here.com/cgi/download.cgi/thisfile.tar.gz". Also make sure you send the appropriate content-type header. Check your webserver docs and give it a shot, though your mileage may vary.