or download this
open my $pdf, "<", "LeasevsBuy.pdf" or handleError($!); # you probab
+ly want to print out an error page instead of just dying.
binmode $pdf;
...
print "Content-Type: application/pdf\n";
print "Content-Length: " .length($output) . "\n\n";
print $output;