in reply to WWW::Mechanize and PDF files

Another possibility: since a Mechanize instance isa LWP::UserAgent perhaps call the head method instead if the link URL matches /\.pdf\$/ and see if that's successful.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^2: WWW::Mechanize and PDF files
by lostjimmy (Chaplain) on Mar 12, 2010 at 21:29 UTC
    ++

    This is a much better solution, since that's exactly what the HEAD request is for. I can't believe I forgot about it!

Re^2: WWW::Mechanize and PDF files
by Ineffectual (Scribe) on Mar 12, 2010 at 21:31 UTC
    Thanks very much, that works great! :)