in reply to saving data locally in CGI script?

If you mean that you want the browser to prompt the user where to download your CSV file, that's a matter of sending the proper HTTP headers. In your case, you need to send the appropriate Content-Disposition header:

print "Content-Disposition: attachment; filename=test.csv\r\n\r\n";

Replies are listed 'Best First'.
Re^2: saving data locally in CGI script?
by Anonymous Monk on Jan 22, 2010 at 22:31 UTC

    Thanks! The following appears to work:

    my $s = "Hi, Mom!\n"; # print "Content-disposition: inline; filename=docket.csv\n"; print "Content-disposition: attachment; filename=docket.csv\n"; print "Content-length: " . length($s) . "\n"; print "Content-type: application/octet-stream\n\n"; print $s;
    Specifying inline or attachment appears to work in the same manner.

    Is there a way to display the standard file-open dialog such that the user can rename the file as desired?

    Thanks, again!