http://www.perlmonks.org?node_id=448955


in reply to Need help with downloading

Never tried to do this, but my instinct says it should be:
print "Content-Disposition:attachment;filename=$filenm","\n";
and not
print "Content-Disposition:attachment;filename=$filenm","\n\n";

Alberto Simões