in reply to Perl CGI output in PDF

the header name is "Content-Disposition" not "disposition" or "filename". update: And you should use a semi-colon to separate the filename argument.

In other words, you should probably use

print $query->header(-expires=>'now', -type=$mimetype, -content_dispos +ition=>"inline; filename=sample.pdf");