use CGI; my $size = length ($blob); my $filename = 'good_data.txt'; print CGI::header( -Content-Disposition => "attachment; filename=$filename", -Content-Type => 'application/octet-stream', -Content-Length => $size, -Pragma => 'no-cache', -Expires => 0 ); print $blob;