use CGI;my $q = CGI->new;open(my $DLFILE, '<', "path/to/your/filename");print $q->header(-type => 'application/x-download', -attachment => 'filename', 'Content-length' => -s "path/to/your/filename", );binmode $DLFILE;print while <$DLFILE>;undef ($DLFILE);