I understand that you have already solved your problem. However, you should be aware that I had another problem with a nearly identical program. The site would not download copyrighted material to a 'browser' they did not recognize. The downloaded file actually was an html file containing the explanation (perl still thought it was pdf.)
Bill
Comment on Re: Perl script to download readable .pdf file.
Thanks! To bad that I did not ask while the site was still in service. I had no idea that there was a solution so I gave up and downloaded the files by hand with my browser.