in reply to Popup Window

Is that really a popup window (composed in HTML), or instead, a "File Save" dialog? I suspect it's the latter, in which case you can skip that step. Actually, likely the previous "popup" is a browser dialog box too.

The click on "File Download" will probably have the server transfer the data of the PDF file to you, and all you have to do is save that data to a file. According to the docs for WWW::Mechanize and LWP::UserAgent, you just need to use the methodget on the mech object and specify the path of the file you want to save it in.

HTH.