stew has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to catalog a directory of PDF's and I am using the PDF (http://search.cpan.org/author/ANTRO/PDF-111/) module to parse each document and get the number of pages. I set up this simple test script which works fine....

use PDF; my $pdf=PDF->new('bop032.pdf'); print "This PDF has ",$pdf->Pages," Pages \n";


When I try to incorporate the above snippet into something more useful that uses other modules etc. I get the following error

Can't locate object method "new" via package "IO::Handle" (perhaps you forgot to load "IO::Handle"?) at insert_pdf.pl line 12.

Am I missing something fundamental about the use of Perl modules or is there something awry with my use of this particular one?????

Cheers

Replies are listed 'Best First'.
Re: Perl module problem
by robartes (Priest) on Oct 30, 2002 at 14:39 UTC
    Could you post the offending code? Without it, we'd be shooting in the dark as to what might be causing your problem (not that this has stopped me before, but sanity has to have its chance from time to time).

    CU
    Robartes-

Re: Perl module problem
by chromatic (Archbishop) on Oct 30, 2002 at 17:09 UTC

    As the error message says, perhaps you forgot to load IO::Handle. Trust the (first) error message.